You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue mentions that tmux supports SGR since 2013 (1.8) and that its DA2 code is 84, but the PR only changed the default of screen. I’ve naïvely added the same simple detection to term.c and it worked for me:
diff --git i/src/term.c w/src/term.c
index b789f3924..c9a2b4126 100644
--- i/src/term.c+++ w/src/term.c@@ -5220,6 +5220,12 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
term_props[TPR_MOUSE].tpr_status = TPR_MOUSE_XTERM;
}
+ if (arg[0] == 84)+ {+ // tmux supports SGR since basically forever+ term_props[TPR_MOUSE].tpr_status = TPR_MOUSE_SGR;+ }+
// If no recognized terminal has set mouse behavior, assume xterm.
if (term_props[TPR_MOUSE].tpr_status == TPR_UNKNOWN)
{
But I’m not sure whether this is a good change for everyone, because of the following questions:
Checking terminal name vs device attributes
In os_unix.c there is also a check for the terminal name (not DA2 response) being tmux which effectively results in the current default of ttymouse=xterm.
From my test I know that the terminal capabilities will take precedence over the name, but is it a good approach? It would mean that someone setting $TERM=tmux without actually being on tmux would not get the new default (might be good or bad).
The resulting documentation might also get very confusing.
Is sgr/xterm2 a sensible default?
Is there a constellation where xterm2 instead of xterm could cause problems?
(sgr seems to be irrelevant here, since it falls back to xterm2 behaviour according to docs when no SGR sequences are sent, and tmux also falls back to X10 sequences if the underlying terminal does not send SGR sequences)
I see two places where xterm2 differs from xterm, and I don’t fully understand the consequences:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
When using tmux I need to set
ttymousetoxterm2orsgr(preferred, since it supports more columns) to drag window borders. 1I was wondering whether it’d be a good idea to make
sgrthe default for tmux. There was a PR/issue for changing the default for screen:The issue mentions that tmux supports SGR since 2013 (1.8) and that its DA2 code is 84, but the PR only changed the default of screen. I’ve naïvely added the same simple detection to
term.cand it worked for me:But I’m not sure whether this is a good change for everyone, because of the following questions:
Checking terminal name vs device attributes
In
os_unix.cthere is also a check for the terminal name (not DA2 response) beingtmuxwhich effectively results in the current default ofttymouse=xterm.From my test I know that the terminal capabilities will take precedence over the name, but is it a good approach? It would mean that someone setting
$TERM=tmuxwithout actually being on tmux would not get the new default (might be good or bad).The resulting documentation might also get very confusing.
Is
sgr/xterm2a sensible default?Is there a constellation where
xterm2instead ofxtermcould cause problems?(
sgrseems to be irrelevant here, since it falls back toxterm2behaviour according to docs when no SGR sequences are sent, and tmux also falls back to X10 sequences if the underlying terminal does not send SGR sequences)I see two places where
xterm2differs fromxterm, and I don’t fully understand the consequences:vim/src/mouse.c
Lines 2796 to 2803 in a200711
vim/src/mouse.c
Lines 2821 to 2825 in a200711
Footnotes
This issue seems to come up from time to time, e.g. https://github.com/vim/vim/issues/6260 https://unix.stackexchange.com/questions/50733/cant-use-mouse-properly-when-running-vim-in-tmux https://superuser.com/questions/549930/cant-resize-vim-splits-inside-tmux ↩
All reactions