F11 to F20 Binding

Asked by SabreWolfy on 2010-10-01

I used byobu over an ssh:

ssh -p XXX -t user@server byobu -R -D

which works well. I use Midnight Commander on the remote machine, which works well. Because of the byobu Function Key bindings (which I'm happy with), I use "ESC 6" for F6 or "ESC 9" for F9 in Midnight Commander, which is fine (pressing F6 detaches and pressing F9 launches the byobu menu).

However, I am not able to submit F11 to F20 keys, which are SHIFT + Fn, in byobu (F11 is Shift+F1 for example).

If I ssh into the server directly (no byobu) and run Midnight Commander and press Shift-F6 (effectively F16) to rename a file in place, it works. Doing the same *within* a byobu session does not work -- it just does nothing.

I realize byobu has to trap Fn keys to work, but why are Shift+Fn keys being intercepted and "blocked" by byobu? There is no way i can find to enter F16/Shift+F6 via the "ESC" method.

Question information

Language:
English Edit question
Status:
Solved
For:
byobu Edit question
Assignee:
No assignee Edit question
Solved by:
SabreWolfy
Solved:
2010-10-01
Last query:
2010-10-01
Last reply:
2010-10-01
Dustin Kirkland  (kirkland) said : #1

I don't have an answer to this question, I'm sorry. You might need to show
the GNU screen developers the keybinding for one of byobu's F-keys and ask
them why screen is trapping shift-Fn too...

SabreWolfy (sabrewolfy) said : #2

When I mentioned previously that Shift-F6 worked in Midnight Commander directly over ssh, I was not using screen.

I've justed tested now via ssh and then launching screen (rather than byobu). Pressing Shift-F6 in Midnight Commander (rename file in place) seems to trigger F8 (delete file), as a red dialog asking if I want to delete the file appears.

Pressing Shift-F6 in byobu does the same (triggers F8) -- I was incorrect when I mentioned previously that Shift-F6 in byobu does nothing. (I'm sure it USED to do nothing when I tried it originally.)

Using Midnight Commander's "Learn Keys" feature, I can now confirm that in byobu/screen, Shift-F1 to Shift-F4 are ignored. Shift-F5 to Shift-F8 map to F17 to F20 for some reason. So Shift-F6 (F16) is actually triggering F18, which seems to be mapping back to F8 (Delete).

Using terminator (gnome-terminal). Exactly the same situation/results using xterm.

I think the easiest solution is to investigate the key rebinding feature of Midnight Commander.

SabreWolfy (sabrewolfy) said : #3

Placing the following two lines:

[panel]
PanelRenameLocal = F16; F18

into ~/.mc/mc.keymap

has "solved" the problem of Shift-F6 (which generates F18 for some reason) in screen/byobu.

Both F16 and F18 should be specified so that Shift-F6 works as expected when in screen/byobu (in which case it returns F18 to Midnight Commander) and when not in screen/byobu (in which case it returns F16).

Have not tested Shift-Fn in programs other than byobu and Midnight Commander.

Murz (murznn) said : #4

Same problem on each tty with Ubuntu Maverick, in konsole or gnome terminal Shift+F6 works normally, but in tty - works like F18. And all other shift combinations mc detects as F13-F20!