59

I use byobu with the tmux backend on my 12.04 server. I'd like to use the midnight commander shortcut keys with it, but the F keys don't work.

I've seen some posts on the issues here:

but they are out of date and don't seem to work for newer versions of byobu. How can I either work around this or use MC in a way that works better?

1
  • 3
    Same goes for htop and others.
    – jrg
    Jun 5, 2012 at 3:34

3 Answers 3

95

You can easily toggle on/off the use of the F-keys inside of Byobu (tmux) by pressing either:

  • shift-F12 (in tmux)

  • ctrl-a-! (in screen)

Full disclosure: I'm the author and maintainer of Byobu.

9
  • 1
    Got it, add source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.tmux.disable to your .byobu/keybindings.tmux at the end
    – Pykler
    Nov 6, 2014 at 20:59
  • 3
    not working :P any of this key bindings
    – QkiZ
    Feb 10, 2015 at 8:56
  • 2
    Dustin, while that works fine for most keys, Shift-Fx seems to be completely ignored by mc when running in Byobu (with Tmux here). I can understand that for shift-F12 (for obvious reasons) – but what do I miss for e.g. Shift-F3 or Shift-F4 (which I frequently need)?
    – Izzy
    Mar 15, 2015 at 18:56
  • 2
    @Dustin: it would be nice to add those short cuts also in the shift-F1 documentation! I was looking for this for a while! Thanks! Dec 6, 2015 at 16:36
  • 3
    You could also use byobu-keybindings command, equivalent to those key combinations.
    – Leo
    Nov 17, 2017 at 14:15
13

On midnight commander to trigger for example the F2 key:

  • Press Alt+2 (simultaneously)
  • Press ESC, 2 (one after the other).

Which is more convenient than switching using:

  • Shift+F12 (in tmux, default on byobu)

  • Ctrl+A+! (in screen)

2
  • This is useful mostly when you use MC inside byobu on Mac OS X, since some F-keys are already used by the system. I find myself using ESC, 9 quite often.
    – gerlos
    Feb 5, 2015 at 10:26
  • 2
    Any way to extend that to Shift-Fx? Even with Byobu keybindings disabled, Shift-Fx seem to be "blind" (don't work). Tried Esc--Shift-4, no effect.
    – Izzy
    Mar 15, 2015 at 19:05
4

Hah, a man after my own heart :)

Short answer: add my ppa (ppa:izx/private) and update byobu (or manually install the deb). Byobu will default to screen as the backend with F-key behavior restored to old 4.x style.

Long answer: Use byobu-select-backend to switch to screen if you haven't already, and add line $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen.disable after the line $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen in /usr/share/byobu/keybindings/common.

Entire patch:

+++ byobu-5.17/usr/share/byobu/keybindings/common
@@ -1 +1,3 @@
 source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen
+source $BYOBU_PREFIX/share/byobu/keybindings/f-keys.screen.disable
+
--- byobu-5.17.orig/etc/byobu/backend
+++ byobu-5.17/etc/byobu/backend
@@ -1,4 +1,4 @@
 # BYOBU_BACKEND can currently be "screen" or "tmux"
 # Override this on a per-user basis by editing "$BYOBU_CONFIG_DIR/backend"
 # or by launching either "byobu-screen" or "byobu-tmux" instead of "byobu".
-#BYOBU_BACKEND="tmux"
+BYOBU_BACKEND="screen"
2
  • 1
    But what if we wanted to keep it with tmux?
    – jrg
    Jun 5, 2012 at 3:34
  • 1
    @jrg: I'm not that familiar with tmux, sorry -- I tried the new byobu but after this now-fixed bug, switched back to the screen-backend because I'm used to it and happy with it, whatever its limitations.
    – ish
    Jun 5, 2012 at 4:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .