vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.29k stars 3.52k forks source link

Feature request: Open files with Cmd + Click #413

Open moretti opened 8 years ago

moretti commented 8 years ago

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

timothyis commented 8 years ago

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

moretti commented 8 years ago

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! 😄

rauchg commented 8 years ago

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

ralyodio commented 7 years ago

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.

rodcloutier commented 7 years ago

@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

doque commented 7 years ago

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

JonWallsten commented 6 years ago

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!

chabou commented 6 years ago

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

Wizek commented 6 years ago

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 commented 6 years ago

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

Now checking if I can make it work.

albinekb commented 6 years ago

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? 🤔

fgarcia commented 5 years ago

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

spina commented 5 years ago

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).

devinrhode2 commented 5 years ago

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.

nahtnam commented 4 years ago

Any update on this? Missing this feature a lot

kpittman-securus commented 4 years ago

@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.

rocket-squirrel commented 4 years ago

@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.

saleh-mir commented 3 years ago

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

giorgio-zamparelli commented 1 year ago

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