Comment 2 for bug 82708

Revision history for this message
Micah Cowan (micahcowan) wrote :

Note: rxvt does not seem to work at all with control-page-up/down in vim, and sends \E[[5^ and \E[[6^ for them.

If you look at :he xterm-modifier-keys, you'll see that screen can only know that control-pgup/down are supported if it can detect that it is running under xterm (TERM is xterm or similar). I verified this by digging around in the vim source code. Vim uses special internal codes, when it detects that its terminal is fully xterm-compatible, to tell itself that the terminal supports modifiers on things like pgup/down.

The trouble is, that if vim detects that it's running under screen, there is absolutely no way for it to tell whether screen is running under an xterm or not, and so no way it can determine control-key support. So there is no way to make control-pgup/down work automagically under vim.

If you know that your own screen sessions will always only be under an xterm-compatible terminal, then your nmap commands will work; a little better might be:

:set t_kN=<ESC>[6;*~
:set t_kP=<ESC>[5;*~

This will enable your vim to recognize not only xterm's Control-pgup/down, but also pgup/down with other modifiers such as alt.

Closing this bug out, due to a lack of fixability. Perhaps if the terminfo database can someday be updated to include capabilities for such things, we can revisit this.