3

Here is what I am trying to do:

  • open Gnome terminal
  • launches with my command prompt
  • ssh into work via VPN
  • launch screen
  • create two screen windows
  • try to use F3 and F4 as "prev" and "next" with no luck.
  • try to use F6 and F7 as "prev" and "next" works fine.

Here is my .screenrc

  hardstatus on
  hardstatus alwayslastline
  hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "
  defscrollback 5000
  startup_message off

  #bind uppercas x to remove region
  bind X remove
  bind ^X lockscreen

  # Bind F3 and F4 (NOT F1 and F2) to previous and next screen window
  bindkey -k k3 prev
  bindkey -k k4 next

  # Bind F5 to switch to next focus
  bindkey -k k5 focus

  bindkey -k k6 prev
  bindkey -k k7 next

  #split window
  bindkey -k k8 split
  bindkey -k k9 remove

What's strange is the following works:

Works 1:

  • Doing this via putty works fine

Works 2:

  • using the exact same .screenrc works fine if I am on my local machine

Doesn't work:

  • using lxterminal has the same issue

My thoughts are that ssh may be causing this but not sure.

EDIT:

Here are the outputs of some terminal related commands:

Local Machine:

$ echo $TERM
xterm

$ infocmp -1 | grep kf.=
    kf1=\EOP,
    kf2=\EOQ,
    kf3=\EOR,
    kf4=\EOS,
    kf5=\E[15~,
    kf6=\E[17~,
    kf7=\E[18~,
    kf8=\E[19~,
    kf9=\E[20~,

Work Machine:

$ echo $TERM
xterm

$ infocmp -1 | grep kf.=
    kf1=\EOP,
    kf2=\EOQ,
    kf3=\EOR,
    kf4=\EOS,
    kf5=\E[15~,
    kf6=\E[17~,
    kf7=\E[18~,
    kf8=\E[19~,
    kf9=\E[20~,

Work Machine using screen:

$ echo $TERM
screen

$ infocmp -1 | grep kf.=
        kf1=\EOP,
        kf2=\EOQ,
        kf3=\EOR,
        kf4=\EOS,
        kf5=\E[15~,
        kf6=\E[17~,
        kf7=\E[18~,
        kf8=\E[19~,
        kf9=\E[20~,
  • What's $TERM and the output of infocmp -1 | grep kf.= on the remote system? How does that compare with the one on the local system? – Stéphane Chazelas Mar 13 '14 at 13:26
  • @StephaneChazelas, added in outputs to the question. – alexpotato Mar 13 '14 at 13:53
  • And when you press CTRL-V F3 (outside of screen) do you see ^[OR? – Stéphane Chazelas Mar 13 '14 at 14:18
  • @StephaneChazelas I do. Actually see it inside of screen as well. – alexpotato Mar 13 '14 at 14:30
  • Are any of those different in putty? What version of screen? – Stéphane Chazelas Mar 13 '14 at 16:35
2

I think I know what it is.

xterm used to send different escape sequences for the F1 to F4 keys.

From the xterm documentation:

Older versions of xterm implement different escape sequences for F1 through F4. These can be activated by setting the oldXtermFKeys resource. However, since they do not correspond to any hardware termi- nal, they have been deprecated. (The DEC VT220 reserves F1 through F5 for local functions such as Setup).

screen used (and you've got quite an old versions, though we would blame you as the newer ones are not official releases) to come with a default /etc/screenrc with:

termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'

That is that tell screen that F1 -> F4 are actually what they used to be in ancient xterms. You should comment out that line in your /etc/screenrc, so that screen takes it from the terminfo/termcap database as expected.

  • I do see that line in the /etc/screenrc however I don't have access to change it. Is it possible to create an over ride in my local .screenrc? – alexpotato Mar 13 '14 at 19:06
  • @alexpotato, yes, I think so, change back with k1=\E[OP... should do it. If not, you can always bindkey the actual sequences – Stéphane Chazelas Mar 13 '14 at 19:49

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.