1

I'm trying to use the f-keys to switch windows on GNU Screen/PuTTy, but I can't get it to work.

This is my current .screenrc:

bindkey -k k1 select 1
bindkey -k k2 select 2
bindkey -k k3 select 3
(...)

Changing the PuTTy keyboard options to "XTerm R6" did not work. I also don't know how discover what keycode is being received by screen when I press a key on Putty.

Edit:

Problem solved! Turns out I had to close and reopen the screen session for the configuration to take effect (I was detaching and reattaching).

My current .screenrc is:

bindkey "\033OP" select 0
bindkey "\033OQ" select 1
bindkey "\033OR" select 2
bindkey "\033OS" select 3
bindkey "\033[15~" select 4
bindkey "\033[16~" select 5
bindkey "\033[17~" select 6
bindkey "\033[18~" select 7
bindkey "\033[19~" select 8

And PuTTy is set to VT100+.

lzm
  • 215

1 Answers1

1

First, you need to figure out what your F1 key produce. I used emacs to do that.

  1. Login your system remotely with putty
  2. Run screen, and then
  3. run emacs -nw
  4. switch to *scratch* buffer (or whatever)
  5. Hit C-q F1 (C-q is quoted-insert and this will puts exact byte you get from F1 key)
  6. Copy that string to your .screenrc

My system, putty on windows accessing Debian unstable amd64 with screen 4.1.0~201203, got ^[[11~, so I put

bindkey "^[[11~" select 1

in my .screenrc and it seems to work.

Hope this helps.