Skip to content

Commit a37b958

Browse files
authored
fix(terminal): open .md file links in viewer instead of externally (#48)
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) Co-authored-by: maskar <Maskar@users.noreply.github.com>
1 parent 69b0a4b commit a37b958

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/TerminalView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ export function TerminalView(props: TerminalViewProps) {
149149
const filePath = link.text.replace(/:\d+(:\d+)?$/, '');
150150
// Resolve relative paths against the task's working directory
151151
const resolved = filePath.startsWith('/') ? filePath : `${props.cwd}/${filePath}`;
152-
// Cmd+click always opens externally; otherwise use callback for .md files
153-
if (!event.metaKey && /\.md$/i.test(resolved) && props.onFileLink) {
152+
// .md files open in viewer; Shift held = open externally instead
153+
if (/\.md$/i.test(resolved) && props.onFileLink && !event.shiftKey) {
154154
props.onFileLink(resolved);
155155
} else {
156156
invoke(IPC.OpenPath, { filePath: resolved }).catch(console.error);

0 commit comments

Comments
 (0)