vim-togglecursor icon indicating copy to clipboard operation
vim-togglecursor copied to clipboard

Support for gnu screen

Open hk4n opened this issue 2 years ago • 2 comments

This is a PR to support GNU Screen

How it works is when you are within a screen session the STY environment variable is set and is detected by the plugin when the togglecursor_enable_gnu_screen_escaping is set. If you exit screen, STY will not be set anymore and and the plugin will use the normal escape sequences.

I decided to not automatically detect if GNU Screen is set if for some reason it breaks compatibility for someone, although I do not think it does since STY is supposed to be a GNU Screen only environment variable.

hk4n avatar May 28 '23 16:05 hk4n

Oh my... I'm so sorry this has sat here so long. 🤦‍♂️ I don't know how I missed this.

I don't use screen, so a few questions here:

  1. Is this still needed?
  2. Would it be better to have it enabled by default and if folks don't want it, turn it off, especially if no harm is done by default?
  3. Is $STY the best way to go about testing for screen? It looks like TERM is set to something like screen.xterm-256color (which is different than I remember... I remember it just using screen, but this new behavior makes sense to me). Would looking for screen. at the beginning be a better way of testing for screen? STY, in my mind, seems like something that someone else might set too--not just screen--but I don't have much evidence for that. :-) I'm happy to keep it as-is, just thought I'd ask the question.

Thanks!

jszakmeister avatar Jan 06 '25 13:01 jszakmeister

Oh my... I'm so sorry this has sat here so long. 🤦‍♂️ I don't know how I missed this.

No worries, I have been using my fork, this PR was to give other screen users an option to hopefully get it working for them too.

I didn't want to enable it by default, it could potentially break for other users that do not use screen. I always think it's better to opt-in than opt-out.

Regarding TERM vs STY, my research at the time indicated that TERM is much more susceptible to user changes when screen is used. I'm aware that there are no guarantees that STY always work, but it was according to me the best alternative out of the two at the time.

I have no hard feelings if you close this PR. I'm slowly migrating to neovim and do not use this plugin there.

hk4n avatar Jan 11 '25 21:01 hk4n