2

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

1 Answer 1

1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .