Key bindings for screen
fatkasuvayu+linux at gmail.com
Fri Oct 21 12:52:20 UTC 2011
I have been trying to setup some keybindings for screen but have been
rather unsuccessful so far. The documentation is very difficult to
understand / follow for me. I was wondering if someone could help me
understand how to specify key combinations with modifier keys.
I want to be able to switch terminals with either `escape key
<arrow>' or `escape key C-<arrow>'. I would also like to change
my escape key from C-a to C-q (easier to navigate in bash and
emacs). These are my attempts so far:
1. Switching terminals: I tried the following for `escape key
<arrow>', but it doesn't work.
bindkey -d ^[[D prev
bindkey -d ^[[C next
Then I tried the following for `escape key C-<arrow>'.
bindkey -d ^[[1;5D prev
bindkey -d ^[[1;5C next
This somewhat works. The problem now is, after swithing the terminals
if I press the escape key for a subsequent command it is interpreted
as the concluding part of a C-a C-a sequence and screen switches to
the original terminal. To give you an example a sequence like this,
`C-a C-<left> C-a A' is interpreted as `prev other A' instead of
2. Changing the escape key: This is more of an issue with the terminal
emulator rather than screen. My terminal emulator (xfce4 terminal)
doesn't pass on the C-q to screen. Strangely when I run emacs in the
terminal (emacs -nw) or I run emacs within screen, C-q is passed
along just fine.
PS: I start screen with `term' set to `xterm'
Open source is the future. It sets us free.
More information about the users