Skip to content

fix(terminal): open .md file links in built-in viewer#48

Merged
johannesjo merged 1 commit intojohannesjo:mainfrom
Maskar:pr/fix-md-viewer-click
Mar 29, 2026
Merged

fix(terminal): open .md file links in built-in viewer#48
johannesjo merged 1 commit intojohannesjo:mainfrom
Maskar:pr/fix-md-viewer-click

Conversation

@Maskar
Copy link
Copy Markdown
Contributor

@Maskar Maskar commented Mar 29, 2026

Summary

Fixes .md file links always opening externally instead of in the built-in markdown viewer.

Problem

After #45 was merged and Ctrl+click was added as a requirement in 933931a, the .md viewer check (!event.metaKey) was always false on Mac since Cmd is required to activate the link. All .md files fell through to the external open path.

Fix

Use event.shiftKey as the "open externally" modifier 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)

Test plan

  • Cmd+click a .md file path in terminal — opens in viewer dialog
  • Cmd+Shift+click a .md file path — opens externally
  • Cmd+click a .ts file — opens externally

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)
@johannesjo
Copy link
Copy Markdown
Owner

Thank you very much!

@johannesjo johannesjo merged commit a37b958 into johannesjo:main Mar 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants