Odd behavior of vim over ssh from Cygwin mintty

9 visualizzazioni
Passa al primo messaggio da leggere

Gary Johnson

da leggere,
11 mag 2023, 17:57:4611/05/23
a vim...@googlegroups.com
I haven't had to use Windows for almost a year and I hardly ever use
a mouse with vim, so I don't know when this behavior might have
changed, but I was verifying the behavior of vim on Ubuntu over an
ssh connection from Cygwin's mintty when I noticed something odd.

Using the mouse, I attempted to visually-select a region of text to
verify that the command/status line showed the number of lines
selected. Instead of doing that, a small decimal number followed by
the letter 'm' appeared where the number of lines selected usually
appears and no lines were selected. A little more experimentation
suggested that the number was the screen line number.

That was using my local build of Vim 9.0.1482 with my normal config
files. The odd behavior did not appear with that version using
"--clean" and did not appear with the version of vim in
/usr/bin/vim, Vim 8.1.2269 plus patches 3612, 3625, 3669 and 3741,
with my normal config files.

I just discovered that the odd behavior also happens when using
GNOME Terminal 3.44.0 on a different Ubuntu machine over ssh to the
original Ubuntu machine. An xterm works fine.

Before I start digging into my configuration files looking for the
problematic setting, does anyone know what the problem might be?

Regards,
Gary

Gary Johnson

da leggere,
12 mag 2023, 05:49:4312/05/23
a vim...@googlegroups.com
I found the problem.

For many years, vim had been unable to properly set the value of
'ttymouse' for some of the terminals I used. Consequently, I added
some code to my vimrc to use the value of the termresponse to
determine the terminal type and to select a value of 'ttymouse' that
seemed to work well with that terminal. A value that often worked
well was "xterm2".

When patch 9.0.1168 was added (on January 10, 2023), vim's method of
determining the value of 'ttymouse' and the control sequences to
enable and disable the mouse changed. The control sequences for
ttymouse=xterm2 were no longer correct for a Cygwin mintty nor for
a GNOME Terminal, at least not when vim had chosen ttymouse=sgr.
The result was the odd behavior I observed.

My current solution is to use my method for determining the value of
'ttymouse' when the patch level is less than 9.0.1168 and accept the
value chosen by vim otherwise.

Regards,
Gary

Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi