Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use this in my .screenrc:

bindkey ^[q prev
bindkey ^[w next

to switch between windows with alt+w/q If I open screen in screen, I can switch like: ctrl+a+a + number, but I would like to id for example with: alt+a/s

Is it possible? Thank you

share|improve this question
up vote 1 down vote accepted

Well. As far as there is no if statement in .screenrc syntax, we should use shell. Assuming your shell is GNU Bash, you can put this in the .bashrc

case "$TERM" in
        [[ $PARENTTERM == screen* ]] && {
            screen -X eval 'bindkey ^[s prev' 'bindkey ^[a next'

(case "$TERM" in block must already exist)

And this in your .screenrc:


So ^[a / ^[s will be bound in every Screen, starting inside other Screen. There is no need to unbind ^[q and ^[w but you can do it.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.