Linux – How to allow Page Up in GNU Screen

gnu-screenlinuxvim

I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows. I use GNU Screen commonly as well. When using Vim inside Screen I am unable to use the Page Up key because Screen interprets it as a command to start copy mode.

I would like to use Page Up for its regular up-paging functionality. How can I configure Screen to do this?

Best Answer

I preferred the answer from superuser:

Add the following to your ~/.screenrc:

termcapinfo xterm ti@:te@
termcapinfo xterm-color ti@:te@

or

termcapinfo xterm* ti@:te@

Scrolling back feels a bit weird because it seems to scroll all windows at once and screen disappears completely if you go back too far but for me that was far the best solution because I don't need to instruct the user to use another shortcut than the well-known Shift+PgUp / Shift+PgDown.

Update: It seems that this solution skips some parts of the output when scrolling. So I cannot recommend it anymore. But I leave the answer here for completeness.

Related Question