jamestalmage / supports-hyperlinks

Detect whether a terminal emulator supports hyperlinks
MIT License
54 stars 13 forks source link

Incorrect results when running screen inside of iTerm #3

Open technicalpickles opened 5 years ago

technicalpickles commented 5 years ago

iTerm's Proprietary Escape Code documentation says:

These may not work properly in tmux or screen

This doesn't work as far as I can tell so far. If that is expected, I think there could be some additional checks in:

https://github.com/jamestalmage/supports-hyperlinks/blob/49a52c1ad86eeb0970c908cc8ad57328554b16c2/index.js#L53-L59

Specifically process.env.TERM seems to be screen for me, even when TERM_APP is iTerm.app

jamestalmage commented 4 years ago

If I'm understanding you correctly. It should be false, but you're getting true?

technicalpickles commented 4 years ago

That's right. It has been a bit, so I don't have the code handy to use it, but hyperlinks don't work inside of screen even if using iTerm.

wodin commented 3 years ago

I just ran into this yesterday.

Hyperlinks work in iTerm2 and supports-hyperlinks correctly says they do:

iTerm2 supports hyperlinks

Hyperlinks do not work in tmux running inside iTerm2, but supports-hyperlinks claims they do:

tmux does not support hyperlinks
LitoMore commented 1 year ago

The behavior is correct. You could use FORCE_HYPERLINK to test hyperlinks compatibility in tmux or screen.

npm i -g terminal-link-cli
FORCE_HYPERLINK=1 terminal-link text http://github.com
wodin commented 1 year ago

The behavior is correct.

I've just tested it again now and it is indeed correct now for tmux.

When I ran into this issue, supports-hyperlinks was returning true for supportsHyperlinks.stdout and supportsHyperlinks.stderr when it was run under tmux.

I tried now with version 2.3.0 it returns false under tmux, as it should.

Unfortunately it still returns true when running under screen, despite screen not supporting hyperlinks.