Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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
    screen*)
        [[ $PARENTTERM == screen* ]] && {
            screen -X eval 'bindkey ^[s prev' 'bindkey ^[a next'
        }
        ;;
esac

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

And this in your .screenrc:

setenv PARENTTERM "$TERM"

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

 
discard

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.