Subject: F1/F2/F3/F4 don't work on my new laptop

From: "Cameron Dale" <[email-masked]>
Date: Wed, 20 Aug 2008 15:05:28 -0700

Hi,

I have been using screen for a while, and I have my function keys
bound to changing the selected terminal like so:

# Use the function keys to switch among windows.
bindkey -k k1 select 1
bindkey -k k2 select 2
bindkey -k k3 select 3
bindkey -k k4 select 4
bindkey -k k5 select 5

I also have this to (according to the comment where I copied it from)
enable the function keys in screen:

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

However, with my new eeepc laptop this is causing problems. Now, F1 F2
F3 and F4 no longer work only on the laptop. If I remove the
termcapinfo line from .screenrc the laptop works fine, but then on all
my other machines F1-F4 stops working! Most frustrating.

I understand this might be related to the terminfo database on my
laptop, but I'm not sure what change to make so that it works like my
other machines. Or, perhaps I need to add another termcapinfo line or
more bindkey lines to my .screenrc to make the function keys work with
the laptop too. If I press ctrl-q and then the F1 - F4 keys, I get the
following key codes from screen:

^[OP ^[OQ ^[OR ^[OS

But I'm not sure what I need to add to .screenrc so they get
transformed into function keys. Please help!

Thanks,
Cameron

_______________________________________________
screen-users mailing list
[email-masked]
http://lists.gnu.org/mailman/listinfo/screen-users

---

From: "Cameron Dale" <[email-masked]>
Date: Thu, 21 Aug 2008 14:09:44 -0700

Hi,

^[OP ^[OQ ^[OR ^[OS

Thanks,
Cameron

---

From: Micah Cowan <[email-masked]>
Date: Fri, 22 Aug 2008 12:10:43 -0700

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

This tells screen to ignore what termcap/terminfo might really have for
k1, and use these entries instead.

> my other machines F1-F4 stops working! Most frustrating.

Sounds like, on the system you're using for the laptop, the original
terminfo lines are correct.

> transformed into function keys. Please help!

Why not use the .screenrc without those lines on your laptop, and the
ones with them on all others? If you have two terminal versions which
respect two different sequences, you can't really expect to have both
the same terminfo definition and the same .screenrc for them both.

What terminal emulator are you using, gnome-terminal? Gnome-terminal
isn't perfectly compatible with xterm, especially when it comes to
special key controls; but it advertises itself as xterm. Probably
because of apps like vim (and screen) that recognize "xterm" as
providing mouse support, but not gnome-terminal.

- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/

---

From: "Cameron Dale" <[email-masked]>
Date: Fri, 22 Aug 2008 12:26:54 -0700

> terminfo lines are correct.

If they're correct, shouldn't the termcapinfo line do nothing then,
that is overwrite the correct ones with entries that are also correct?
Sorry, I know almost nothing about termcap/info.

> the same terminfo definition and the same .screenrc for them both.

The problem is when I ssh into a server machine from different places,
then screen runs on the server and uses the server's .screenrc file.
Either I have the termcapinfo line in .screenrc on the server and all
desktops work but my laptop doesn't, or I remove the line to get my
laptop to work and the desktops no longer work.

> providing mouse support, but not gnome-terminal.

I'm using konsole, and it looks like that might be the culprit. I
tried running xterm on my desktop instead, and it behaves just like my
laptop (works fine without the termcapinfo line). I'll try on some of
my other machines later tonight.

Thanks,
Cameron