Given t-undercurl-pink.vim:
let &term = 'tmux-256color' hi SpellBad cterm=undercurl set spell
vim -Nu t-undercurl-pink.vim t-undercurl-pink.vim will cause a pink cursor color for me (with rxvt-unicode as the terminal), and keeps it on exit. It does not happen when using gnome-terminal.
This appears to be related to t_Cs being set incorrectly:
% TERM=tmux-256color vim --cmd 'echom &t_Cs' -c q
^[]12;%p1%s^G
Via #2424 (comment).
I've just tried #2126, but it does not appear to fix it.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
Figured out what is going on: tmux itself has a Cs extension to set the cursor color (and Cr to reset it).
It does not show up in infocmp by default, but only with -x:
TERM=tmux-256color infocmp -A /usr/share/terminfo -x | grep Cs
Cs=\E]12;%p1%s\007
Pink appears to be the default here without an argument, but it can be set to red using TERM=tmux-256color tput Cs 1 etc.
What can be done about this?
a) Should Vim look into terminfo (via TGETSTR/tgetstrr I assume) for its internal extensions (all of https://github.com/vim/vim/blob/c75878c923034b883090aef3f08f565513d98f4d/runtime/doc/term.txt#L321-L358?) after all?
b) Should t_Cs only be used if t_Ce (to end it) is also set?
Just to be clear: I've meant to skip looking for "Cs", "Ce" etc, but it looks like it is handled normally? (i.e. looked up) - https://github.com/vim/vim/blob/c75878c923034b883090aef3f08f565513d98f4d/src/term.c#L1589
I think using b) here also would then fix it already, but I still think that querying for non-standard options could be skipped maybe. OTOH querying them allows you to set them in your terminfo file instead of vimrc, not sure about that though.
Figured out what is going on:
It does not show up in
infocmpby default, but only with-x
@blueyed Thanks for looking into this. I didn't know about -x, that would have saved me hours of confusion last time around.
tmux itself has a
Csextension to set the cursor color (andCrto reset it).
This is not just an obscure tmux extension, it is in the xterm terminfo as well:
$ TERM=xterm infocmp -1x | grep C[sr]
Cr=\E]112\007,
Cs=\E]12;%p1%s\007,
a) Should Vim look into terminfo (via
TGETSTR/tgetstrrI assume) for its internal extensions (all of ?) after all?
Should already happen in get_term_entries().
The problem here is a naming conflict between the terminals' extensions and Vim's internal extensions.
Vim queries the Cs entry assuming it represents the undercurl sequence, when in fact it represents the cursor color sequence.
Maybe Vim should take into account the names widely agreed upon for well-known terminfo extensions.
Not as far as I know - I am Neovim by default, so not really affected.
FWIW for undercurls vim should use https://man.openbsd.org/tmux#Smulx and check for it in particular. t_Cs is a tmux extension as it was mentioned above https://man.openbsd.org/tmux#Cs and since it's a part of xterm, each xterm derived terminfo has t_Cs. neovim for example checks for Smulx https://github.com/neovim/neovim/blob/e11e93d1394df83a93c83de5b60639f5085d69dd/src/nvim/tui/tui.c#L1952.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
To whoever is fixing this in the future: I'll save you a few minutes and remind you that ncurse's tgetstr only looks at the first two characters if the id. So that won't work for getting Smulx. Maybe use tigetstr instead?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Okay, but I'm not sure I understand your point. Vim doesn't use ncurses. Or am I missing something...?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()
Okay, but I'm not sure I understand your point. Vim doesn't use ncurses. Or am I missing something...?
AFAIK, Vim does use ncurses when in Console mode. gvim doesn't.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.![]()