2

I use iTerm2 on Mac and have customized control + and control + to send hex 0x01 and 0x05 when pressed - which makes the cursor jump to the start and end of the line when typing or editing commands (opposed to one word at a time) - and the alt key plus an arrow makes the cursor move one word at a time.

This works fine on remote linux systems when using SSH, until I start a screen session. The control + still works fine, but when I try to use control + I just get a message in the screen status area:

No other window.

I found documentation that suggested adding these lines to /etc/screenrc or ~/.screenrc would bind the keys to next and previous windows:

bindkey "^[[5D" prev
bindkey "^[[5C" next

And I thought the syntax for unbinding was to use this line with no command:

bindkey "^[[5D"
bindkey "^[[5C"

I've also tried it with as follows:

bindkey "^[[01"
bindkey "^[[05"

None of these things seem to work.

/etc/screenrc is completely unchanged for Ubuntu 16.04 and there is no ~/.screenrc file at the moment ( i.e. nothing non-standard interfering )

How can I unbind this or debug it further to figure out where the hangup is?

1
  • Do you have to use screen? Does this issue happen in tmux (an alternative)?
    – Tigger
    Jun 3 '17 at 11:15
3

The code 0x01 is Control-A which is the default command character in screen, so when you do control + twice you have the default action binding of other, i.e. other window, hence the message.

You can change to a different command character, eg Control-b when you start screen:

screen -e^Bb

or you can put in your ~/.screenrc the line

escape ^Bb
1

You've set Ctrl+Left to send the character ^A (Ctrl+A). This is the same character that Ctrl+A sends, and ^A is the default prefix character for Screen's key bindings.

bindkey "^[[5D" prev in the Screen configuration is useless for two reasons. First, this defines what happens when Screen receives this escape sequence after the prefix character, i.e. after a ^A. Second, ^[[5D is what some terminals send for Ctrl+Left, but you've reconfigured your terminal to send something different (^A).

Instead of making Ctrl+Left send ^A, make it send ^[[1~ or ^[OH (where ^[ is an escape character). Likewise make Ctrl+Right send ^[4~ or ^[OF instead of ^E. These are escape sequences normally sent by the Home and End keys.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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