Sample Header Ad - 728x90

Cmd-clicking on the names of sh/md files in iTerm2 opens them in the browser (non-deterministically)

2 votes
1 answer
131 views
I am using macOS Sonoma 14.1.2 with iTerm2. I often search for files in the terminal, which then I would like to open by Cmd+clicking on their name. This should open them in the default text editor. However, I noticed that certain file formats, such as Markdown (.md) and Shell (.sh), are sometimes picked up as URLs and are opened in my default brower. To reproduce, run: cd /tmp touch hello.md world.sh echo hello.md world.sh The when clicking on the printed hello.md and world.sh strings, the result is either opening the browser (to load https://hello.md/ or https://world.sh/ ), or it is opening the respective files in the default text editor. The exact choice is non-determistic. Is there a way to disable interpreting these filenames as URLs?
Asked by Gabor Szarnyas (121 rep)
Dec 7, 2023, 12:59 PM
Last activity: Feb 14, 2025, 04:21 PM