termlink icon indicating copy to clipboard operation
termlink copied to clipboard

Support alacritty

Open FalcoSuessgott opened this issue 3 years ago • 5 comments
trafficstars

Hi Im about to use this library for a project of mine. I have tested in and discovered that alacritty is currently not supported. Alacritty supports an URL behaviour similar to other terminals:

echo -e '\e]8;;http://example.com\aThis is a link\e]8;;\a'

Possible to support this. So far I havent seen any Env var that alacritty sets that we can use to detect the users terminal. Maybe I will provide a PR if I have an Idea.

Btw, you aware of this list https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda?

FalcoSuessgott avatar Oct 24 '22 16:10 FalcoSuessgott

Hey there, thanks for your interest in this repo!

This project was initially made super quick, and I didn't bother to add support for every hyperlink supported terminal in existence, so yeah, a lot of terminals are missing (for example, VSCode, which supports it in newer version)

Possible to support this. So far I havent seen any Env var that alacritty sets that we can use to detect the users terminal. Maybe I will provide a PR if I have an Idea.

Neither have I, PRs welcome

Since I didn't know what environment variables to test for, the supports hyperlink code was initially ported from zkat/supports-hyperlinks, which is a library written in Rust, and although I didn't know any Rust, it was pretty easy to change it to Go. There wasn't Alacritty there, so I couldn't add it.

I checked the JS supports-hyperlinks as well, and it looks like there isn't an environment variable to check whether the terminal is Alacritty either.

Btw, you aware of this list gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda?

Yup, I think I've checked it once, cool list though.

savioxavier avatar Oct 24 '22 18:10 savioxavier

Hello there,

I decided to revisit this project and felt like termlink needed a full rewrite.

I apparently found out that there exists a TERM variable. On alacritty, its value is alacritty. I've (possibly) fixed this in #8 and released a version ~~v2.0.0~~ v1.3.0 (Go doesn't allow pure semver?). Could you please update termlink and see if this works now?

I'll reopen it now and keep it so, until it is fixed.

savioxavier avatar Jun 12 '23 11:06 savioxavier

Just remembered this! I can verify that alacritty works to me now. Thanks to you, I can now redirect the output from vkv to the secret in Vaults UI! :)

FalcoSuessgott avatar May 10 '24 08:05 FalcoSuessgott

No problem! I was glad to help!

savioxavier avatar May 11 '24 00:05 savioxavier

Im so sorry I must have been tripping. I was testing within vscode not realizing it wasnt alacritty ... However, I got hyperlinks to work but only when overwriting the TERM env var to alacritty as defined in supportsHyperlinks(), but my current OS default is xterm-256, do you happen to know if that is default value when running alacritty? Im currently testing it

FalcoSuessgott avatar May 11 '24 10:05 FalcoSuessgott

Alright, I have figured it out. termlink didn't work due to misconfiguration on my side. When following the Post Install Steps for Alacritty, the TERM var should be set to alacritty or alacritty-direct, mine was still on xterm-256 form on old dotfile configuration ...

Removing the obsolete dotfile setting and installing alacritty correctly, termlink lib now works correctly in vkv.

Thanks for your patience lol ..

FalcoSuessgott avatar May 14 '24 12:05 FalcoSuessgott