Skip to content

Build your personal knowledge base with Trilium Notes

Shortcut to open link

SiriusXTb7e7196f4807
diff --git a/src/public/app/services/link.ts b/src/public/app/services/link.ts
index f9d5912d4a..a0d464741b 100644
--- a/src/public/app/services/link.ts
+++ b/src/public/app/services/link.ts
@@ -278,15 +278,20 @@ function goToLinkExt(evt: MouseEvent | JQuery.ClickEvent | JQuery.MouseDownEvent
const { notePath, viewScope } = parseNavigationStateFromUrl(hrefLink);
const ctrlKey = utils.isCtrlKey(evt);
+ const shiftKey = evt.shiftKey;
const isLeftClick = "which" in evt && evt.which === 1;
const isMiddleClick = "which" in evt && evt.which === 2;
const targetIsBlank = ($link?.attr("target") === "_blank");
const openInNewTab = (isLeftClick && ctrlKey) || isMiddleClick || targetIsBlank;
+ const activate = (isLeftClick && ctrlKey && shiftKey) || (isMiddleClick && shiftKey);
+ const openInNewWindow = isLeftClick && evt.shiftKey && !ctrlKey;
if (notePath) {
- if (openInNewTab) {
+ if (openInNewWindow) {
+ appContext.triggerCommand("openInWindow", { notePath, viewScope });
+ } else if (openInNewTab) {
appContext.tabManager.openTabWithNoteWithHoisting(notePath, {
- activate: evt.shiftKey ? true : targetIsBlank,
+ activate: activate ? true : targetIsBlank,
viewScope
});
} else if (isLeftClick) {