Scroll wheel behaviour in vim with gnome-terminal# Nov 4, 2023
I intentionally have mouse support disabled in
vim, as I find not being able to
select text the same way as in any other terminal screen unergonomic.
However, this has an annoying problem as a
gnome-terminal user: the
terminal, on switching to an “alternate screen” application like
vim that has
mouse support disabled, “helpfully” maps scroll wheel events to arrow up/down
This is possibly fine, except I use the scroll wheel click as middle-button paste, and I’m constantly accidentally pasting something in the wrong place as a result.
This is unfixable from within
vim, since it only sees normal arrow key
ScrollWheelUp and so on).
However, you can turn this off in
libvte, by the magic escape sequence:
echo -ne '\e[?1007l'