[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with Control+PageUp and PageDown
From: |
Micah Cowan |
Subject: |
Re: Problem with Control+PageUp and PageDown |
Date: |
Wed, 07 May 2008 11:26:54 -0700 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080227) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michel Peterson wrote:
> Hi, I'm having this problem for which I can't find a solution anywhere.
>
> Whenever I am within Screen and I press Control+Page(Up|Down) the right
> escape isn't passed to the running app, in this case vim. But if I
> press, Control+V and then that combination I can see the right escape
> sequence ( [[6;5~ for Control+PageDown ).
The problem isn't that screen isn't sending the right escape sequence
(your Control+V example pretty much proves that); it's that Vim doesn't
know to expect it: the TERM environment variable is set to "screen",
whereas Vim wants to see "xterm" or similar to get special
Control+PageDown sequences. IIRC, it's not possible to specify these
sequences in a termcap nor terminfo database, so Vim is forced to check
for specific terminal names to know about these.
Setting the term type to "xterm" may be a poor idea, since screen may
send some escapes that are not compatible with the xterm terminfo entry;
a better solution is to set the appropriate termcap entries explicitly
in your .vimrc.
For instance, if you look at the output from ":set termcap" in Vim under
xterm, you'll see, among other things: "t_kN <PageDown> ^[[6;*~". This
is a special sequence that Vim uses to tell itself that it's handling
xterm-style modified special keys. It didn't get those from terminfo; it
got it from the terminal name.
if &term == "screen"
exec "set t_kN=\<ESC>[6;*~"
endif
Makes Control-PageDown work for me under screen. Look at the other
entries in the ":set termcap" output to find the other ones to add, such
as for Control-PageUp.
- --
HTH,
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer,
and GNU Wget Project Maintainer.
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIIfRt7M8hyUobTrERAlNoAJsGRe5JbrLfgsGSwvJLeLm0ta/TigCdFjs9
Kb2y1DdznyX+5hSC5UjQRbw=
=HnaR
-----END PGP SIGNATURE-----