hyper icon indicating copy to clipboard operation
hyper copied to clipboard

Feature request: Open files with Cmd + Click

Open moretti opened this issue 8 years ago • 19 comments

This is an iTerm feature: screen shot 2016-07-26 at 2 41 19 pm I use it every day for opening a URL with the default browser :-) openurl

moretti avatar Jul 26 '16 13:07 moretti

This is available as a plugin. https://github.com/zeit/hyperlinks

timothyis avatar Jul 26 '16 13:07 timothyis

This is more advanced, for example, is this case: screen shot 2016-07-26 at 2 51 24 pm Cmd + Click on "foo" opens the folder in Finder, and Cmd + Click on "hello.txt" launches the default text editor.

Yeah, I think it should be probably implemented as an external plugin.

Thank you for suggesting hyperlinks! 😄

moretti avatar Jul 26 '16 13:07 moretti

I like that a lot. I want to handle hyperlinks in hyperterm core as well, so we'll keep this open.

rauchg avatar Jul 26 '16 17:07 rauchg

if i do cmd-click it opens in hyper i want the opposite. to open in default browser on cmd click.

also how do I exit a web page opened in hyper? I always end up quitting.

ralyodio avatar Dec 16 '16 01:12 ralyodio

@chovy You can change the default in the plugin to use the default browser on click by changing the defaultBrowser option see Change link target

To close the page just hit ctrl-c with Hyper window focused. See Usage

rodcloutier avatar Apr 30 '17 06:04 rodcloutier

This would be an amazing feature! I use it all the time on iTerm as well.

doque avatar Jul 14 '17 07:07 doque

I want to request this as well. It's super useful when for web development when linting or compiling. If you get an error you can easily go to that file and fix the error instead of searching for the file in the project. iTerm2 has this functionality as well!

JonWallsten avatar Jan 15 '18 07:01 JonWallsten

Hyperlinks are now handled by our v2 (without any modifier). But we need more work to open files.

chabou avatar Apr 16 '18 22:04 chabou

Any news on this? Couldn't files be relatively easily detected with a regex like the following?

/[a-zA-Z0-9\/.]\S+:[[:digit:]]+|[a-zA-Z0-9\/.]\S+:\([[:digit:]]+/

Maybe the plugin called https://github.com/zeit/hyperlinks/issues/43 could easily be extended to accomodate that regex and open $EDITOR? Sounds like such a simple change, but maybe because I don't know much at all about the plugin architecture. I'm only now trying out hyper, and this is an important feature for me.

Also, it's not only just iTerm that has similar functionality, Terminator is able to open files as well by clicking: https://github.com/arnaudh/terminator-plugins/blob/master/open_any_file_plugin.py

Wizek avatar Sep 13 '18 13:09 Wizek

Good news, I've found something highly relevant: https://www.npmjs.com/package/hyper-match

Now checking if I can make it work.

Wizek avatar Sep 13 '18 13:09 Wizek

Hyper is using https://github.com/zeit/hyper/blob/canary/lib/components/term.js#L13 xterm linkify addon to add the links. See docs @ http://docs.xtermjs.org/module-xterm_addons_linkify_linkify.html, doesn't look like there's an option to provide the regex? 🤔

albinekb avatar Sep 13 '18 14:09 albinekb

Recently I started to use a laptop with Linux and I am desperately looking for a way to enable clickable file paths. However after going through some linux terminals (all of which seem to depend on xterm) I am so surprised to see that none supports clickable file paths (but some do normal urls). So I hope this feature gets implemented independently of what xterm does.

I guess that I am just part of a minority who thinks that being able to click on a console linter error, a test error or stack trace is a huge deal.

As part of that minority I can only say that I would love Hyper for many years if it gets that feature

fgarcia avatar Dec 18 '18 13:12 fgarcia

What about matching File URIs like:

file:///Users/spina/path/to/checkstyle_report.html

This isn't as general as requested above, but would dramatically improve some tasks I regularly perform (such as opening an HTML file emitted by my build system).

spina avatar Feb 07 '19 09:02 spina

I believe linting tools could print out file url's like @spina mentioned, and that hyperterm should support this as they would be sort of standard clickable links (just not http) - but I haven't tested this

But then you have some visual clutter :(

Maybe if linting tools output.... markdown? And there was a hyper term plugin to render the markdown in rtf or something. Would benefit documentation too.

devinrhode2 avatar Aug 17 '19 14:08 devinrhode2

Any update on this? Missing this feature a lot

nahtnam avatar Dec 20 '19 09:12 nahtnam

@rocket-squirrel If the linked PR will close this issue, will the PR enable hyper to open files?

My use case is, if a linter command is run and the output says there's an issue in a certain file, I would like to be able to Cmd+Click (or Ctrl+Click on Win) and open the file in the associated editor.

kpittman-securus avatar May 06 '20 21:05 kpittman-securus

@kpittman-securus, I'm sorry this issue was linked by mistake. I scanned through open issues related to web-links and somehow completely missed the "file" part in this one. I'll unlink it from PR to avoid further confusion.

For file links though, we could borrow TerminalLinkHandler from VSCode - essentially register another link matcher with universal file path regex.

rocket-squirrel avatar May 07 '20 00:05 rocket-squirrel

Any updates on this handling files? It'd be great if you can 🙏

saleh-mir avatar Dec 19 '20 14:12 saleh-mir

warp terminal does support click to open on file paths https://www.warp.dev/

giorgio-zamparelli avatar Aug 04 '23 07:08 giorgio-zamparelli