From 7e73cf32e2d34159d4f4870d3bdf287c0ba2edae Mon Sep 17 00:00:00 2001 From: maskar Date: Sat, 28 Mar 2026 22:44:28 -0500 Subject: [PATCH] fix(terminal): open .md file links in viewer instead of externally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Ctrl/Cmd+click modifier requirement meant .md files always took the external path since metaKey was always true. Use Shift as the modifier to force external open instead. - Cmd/Ctrl+click on .md → opens in built-in viewer - Cmd/Ctrl+Shift+click on .md → opens externally - Cmd/Ctrl+click on other files → opens externally (unchanged) --- src/components/TerminalView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/TerminalView.tsx b/src/components/TerminalView.tsx index 8409536a..396bcf2c 100644 --- a/src/components/TerminalView.tsx +++ b/src/components/TerminalView.tsx @@ -149,8 +149,8 @@ export function TerminalView(props: TerminalViewProps) { const filePath = link.text.replace(/:\d+(:\d+)?$/, ''); // Resolve relative paths against the task's working directory const resolved = filePath.startsWith('/') ? filePath : `${props.cwd}/${filePath}`; - // Cmd+click always opens externally; otherwise use callback for .md files - if (!event.metaKey && /\.md$/i.test(resolved) && props.onFileLink) { + // .md files open in viewer; Shift held = open externally instead + if (/\.md$/i.test(resolved) && props.onFileLink && !event.shiftKey) { props.onFileLink(resolved); } else { invoke(IPC.OpenPath, { filePath: resolved }).catch(console.error);