I figured it was something wrong in the terminfo settings for xterm, which is what mintty emulates.
I used esr's showkey
to dump what the terminal was sending for Shift-Up, Shift-Down:
^[ 1 ; 2 A shift-up
^[ 1 ; 2 B shift-down
I decompiled the terminfo entries for xterm
(which didn't work properly) and rxvt
(which did, when run in an rxvt terminal) with infocmp -L xterm
and infocmp -L rxvt
, and noticed that the sequences above were mapped for xterm
to key_sr
(kind
) and key_sf
(kri
) - see the definition of those guys here. But rxvt
had no such entries.
So I tweaked the entries:
$ infocmp xterm > xterm.ti
Applied this change:
- kind=\E[1;2B, kmous=\E[M, knp=\E[6~, kpp=\E[5~,
- kri=\E[1;2A, mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El,
+ kmous=\E[M, knp=\E[6~, kpp=\E[5~,
+ mc0=\E[i, mc4=\E[4i, mc5=\E[5i, meml=\El,
Compiled and installed updated xterm:
$ tic xterm.ti
This fixed selection with Shift+Up in emacs.