incorrect handling of shift+pageup and shift+pagedown despite terminfo entries
so the usual xterm has the following terminfo bit:
kEND=\E[1;2F, kHOM=\E[1;2H, kIC=\E[2;2~, kLFT=\E[1;2D,
-->kNXT=\E[6;2~, kPRV=\E[5;2~, kRIT=\E[1;2C, kb2=\EOE, kbs=^?,
kcbt=\E[Z, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
but shift+pageup and shift+pagedown appear to send escapes to our event loop triggering the following condition
se c (VtyEvent (EvKey KEsc _)) = halt c
there is a workaround that utilizes providing our own inputMap via
vtyConfig :: Config
vtyConfig = defaultConfig { inputMap = (Nothing, "\ESC[6;2~", EvKey KPageDown [MShift]) :
(Nothing, "\ESC[5;2~", EvKey KPageUp [MShift]) :
inputMap defaultConfig
}
but this seems unideal as these key streams are already mapped in the terminfo, which defaultConfig should consult.
Thanks for the report!
Judging by the documentation for terminfo, the capabilities you mentioned do not correspond to modified versions of Page Up and Page Down. As far as I can tell they correspond to those keys without the Shift modifier.
Still, it is strange indeed that your Esc handler is getting triggered by those keypresses. What terminal emulator are you using?
i observed this on gnome-terminal on ubuntu, which reports itself as xterm-256color but was unable to reproduce the error on iterm2 on macos. it is also not observed on an xterm session or urxvt session on the same ubuntu machine.
on a separate archlinux machine running urxvtd and urxvtc, i also cannot observe the escape events.
as an aside, the unmodified versions of pageup and pagedown are \ESC[5~ and \ESC[6~ corresponding to the kpp and knp entries of terminfo. perhaps this issue should get escalated to gnome-terminal instead? it seems kind of odd that only gnome-terminal exhibits this behavior and it treats shift+pageup and shift+pagedown normally while in zsh. perhaps @ggrieco-tob can comment on his experiences.
Thanks for that detail. I did want to mention something else, too: vty does not use any of the terminfo capabilities you have mentioned.