tmux and function keys over ssh

184 views
Skip to first unread message

Frank Carmickle

unread,
Aug 1, 2022, 4:58:36 PM8/1/22
to tmux-...@googlegroups.com
Greetings

I had gotten this working a few months back now. I was very happy with the results. Since then f1 through f5 stopped being interpreted by tmux and now A through E are printed to the terminal. I've trie rolling back software, and I've tried other hardware, to no avail. Can anyone point me in some direction for debugging this? Tmux is not the only application that f1-f5 started behaving this way, so I'm sorry if this is off topic. Please let me know if there's somewhere else I should turn.

Thank you,
--FC


Nicholas Marriott

unread,
Aug 1, 2022, 4:59:34 PM8/1/22
to Frank Carmickle, tmux-users
What is TERM outside tmux? What terminal are you using?

If you run "cat" outside tmux and press F1, what do you see?



--
You received this message because you are subscribed to the Google Groups "tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/0C3D11A2-7A7C-4633-AA8F-7EEC574663C9%40carmickle.com.

Frank Carmickle

unread,
Aug 1, 2022, 5:14:41 PM8/1/22
to Nicholas Marriott, tmux-users
Hello Nicholas,

Thanks for the very speedy response.

> On Aug 1, 2022, at 4:59 PM, Nicholas Marriott <nicholas...@gmail.com> wrote:
>
> What is TERM outside tmux? What terminal are you using?

The linux virtual terminal, terminal type is linux.

If you run "cat" outside tmux and press F1, what do you see?


^[[[A

--FC

Nicholas Marriott

unread,
Aug 1, 2022, 5:16:16 PM8/1/22
to Frank Carmickle, tmux-users
Are you sure it is ^[[[A (three [) and not ^[[A (two)?

What does "tput kf1|cat -v" show?

Nicholas Marriott

unread,
Aug 1, 2022, 5:21:26 PM8/1/22
to Frank Carmickle, tmux-users
^[[A is normally Up, not F1.

If it is really ^[[[A, you can tell tmux using terminal-overrides, something like (use \E where cat shows ^[):

set -as terminal-overrides 'linux:kf1=\E[[A'

But it seems likely you have the keymap messed up somehow because changing this would be seem a silly thing for the terminal to do unnecessarily.

Frank Carmickle

unread,
Aug 2, 2022, 1:58:59 AM8/2/22
to Nicholas Marriott, tmux-users

> On Aug 1, 2022, at 5:16 PM, Nicholas Marriott <nicholas...@gmail.com> wrote:
>
> Are you sure it is ^[[[A (three [) and not ^[[A (two)?
>
> What does "tput kf1|cat -v" show?

Frank Carmickle

unread,
Aug 2, 2022, 1:59:08 AM8/2/22
to Nicholas Marriott, tmux-users

> On Aug 1, 2022, at 5:21 PM, Nicholas Marriott <nicholas...@gmail.com> wrote:
>
> ^[[A is normally Up, not F1.
>
> If it is really ^[[[A, you can tell tmux using terminal-overrides, something like (use \E where cat shows ^[):
>
> set -as terminal-overrides 'linux:kf1=\E[[A'
>
> But it seems likely you have the keymap messed up somehow because changing this would be seem a silly thing for the terminal to do unnecessarily.

According to dumpkeys -nk F1 is ^[[A and not as I am experiencing ^[[[A

What middle layer could be mucking with this?

Thanks so much for the help.

Nicholas Marriott

unread,
Aug 2, 2022, 2:05:07 AM8/2/22
to Frank Carmickle, tmux-users
I don't know how the Linux console works so I can't tell you.

But you need the escape sequence sent by the key to match what terminfo says (for kf1, kf2 etc) or tmux and other applications will not recognise it.

M Kelly

unread,
Aug 2, 2022, 3:04:21 PM8/2/22
to tmux-users
Hi,

Did you ssh to a host and then once there your TERM is set to linux ?
I have experienced that before, for some unknown reason the TERM was forced to that or was not being preserved across ssh.
If so, try changing it.

Tobias Damisch

unread,
Aug 2, 2022, 3:56:27 PM8/2/22
to tmux-users
Not sure if I am able to help, but I also had some problems with different $TERM values
on local and remote machine, my best solution is setting both to "xterm-256color".
Means I have the line:
set -g default-terminal "xterm-256color"
in my .tmux.conf, my local $TERM was alreay set to that value.

HTH,
Tobias


> Gesendet: Dienstag, 02. August 2022 um 02:31 Uhr
> Von: "Frank Carmickle" <fr...@carmickle.com>
> An: "Nicholas Marriott" <nicholas...@gmail.com>
> Cc: "tmux-users" <tmux-...@googlegroups.com>
> Betreff: Re: tmux and function keys over ssh
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/4B733610-F0EA-415B-AADF-59B01C58950E%40carmickle.com.
>

Tobias Damisch

unread,
Aug 2, 2022, 4:30:15 PM8/2/22
to tmux-users
Ah, and setting:

set-window-option -g xterm-keys on

in .tmux.conf also helped

Frank Carmickle

unread,
Aug 2, 2022, 5:19:25 PM8/2/22
to Nicholas Marriott, tmux-users
Thank you again, Nicholas.

Installing and configuring properly the console-setup package on Debian corrected this issue and left me with another one, which I subsequently sorted. My right alt, well really the right option key, no longer brought me to consoles 13-24. Reconfiguring the console-setup package after reconfiguring the keyboard-configuration package solved that. Initially I had not installed any console-setup packages, which I believed would leave me with the kernels default keymap?

Best,
--FC
Reply all
Reply to author
Forward
0 new messages