rpwoodbu / mosh-chrome

Mosh for Chrome
GNU General Public License v3.0
372 stars 59 forks source link

Detect links / URLs, open on ctrl+click #182

Open alexsapps opened 6 years ago

alexsapps commented 6 years ago

The normal SSH/hterm/shell app for Chrome detects URLs and underlines them on hover and opens the link on ctrl+click. I'd like this for mosh-chrome too.

rpwoodbu commented 6 years ago

I am surprised to learn that the released Mosh for Chrome has such an old hterm that this feature isn't available! I really need to do a release.

In the interim, you can install "Mosh for Chrome (dev)" from the Chrome Web Store and get the ctrl+click functionality. (Although, I have not seen underlines... is that an option in hterm?)

vapier commented 6 years ago

it's news to me that hterm automatically underlines links :)

maybe you're thinking of OSC-8 instead ?

ctrl+click does work in the latest hterm though.

alexsapps commented 6 years ago

Sorry I was wrong about automatic underlining. My usual SSH host was down at the time of writing so I just went off the best of my (wrong) memory.

gordol commented 6 years ago

fwiw, i'm running this on latest hterm, and URLs are not clickable...

perhaps there is some other flag to pass to make that possible.

vapier commented 6 years ago

it's hard to guess at what you're trying to do exactly. did you hold Ctrl down before clicking?

gordol commented 6 years ago

did you hold Ctrl down before clicking

yep.

i figured out the problem... it works if i'm not in tmux, otherwise, tmux seems to be capturing the mouse input and it never triggers, or something... maybe it's the ctrl modifier key. either way, ctrl+click on latest hterm does indeed work, in a plain shell

vapier commented 6 years ago

sounds like you turned on tmux's mouse mode

gordol commented 6 years ago

mouse mode or not, it doesn't work within tmux, btw. i know how to turn mouse mode on and off, lol

vapier commented 6 years ago

my point is, if you've turned on mouse mode, then hterm should not be hijacking ctrl+mouse for its own use. your clicks (including key modifiers) are sent to the remote side so it can interpret things.

if you google for 'tmux mouse mode', you'll find some docs to control it.

gordol commented 6 years ago

... I literally just said I know about mouse mode in tmux. what's your point? lol

gordol commented 6 years ago

this works if you just use latest libapps. see my fork here for an example: https://github.com/gordol/mosh-chrome/commit/75b0057abfa7b16626f499e6322890d6ff25744a

rpwoodbu commented 6 years ago

@gordol, be sure you're running "Mosh (dev)" from the Chrome Web Store. I mentioned in my first comment that this isn't in the released version (non-dev). I hope to do a release soon.

gordol commented 6 years ago

I'm running my own fork that's more updated than the dev build in the app store.

rpwoodbu commented 6 years ago

@gordol Sure, but I think you'll find this works at HEAD, which is pushed to "Mosh (dev)". (Yes, I know, I need to do a stable release...)

Also, I forgot to mention that I use tmux 100% of the time, and don't have troubles clicking links. I don't have mouse mode enabled.