Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modify Key-Bindings in Byobu

Tags:

byobu

I have recently installed byobu terminal multiplexer, and I found that I am not able to move in a fast way through the terminal. In linux you can do: Control+Arrows (Left/Right). I want to find the same but in byobu.

And I would like to configure it, in order to be able to use Ctrl+Left and Ctrl+Right if it's possible, not other combinations.

Any idea?

I have tried already this: How to make byobu forward-word and backward-word with CTRL+arrow? But is not working for me. Ubuntu 13.10

Thanks in advance.

like image 790
cucurbit Avatar asked Jun 13 '14 14:06

cucurbit


People also ask

How do I change byobu Keybindings?

One way to change your key bindings is to edit /usr/share/byobu/keybindings/f-keys. tmux (or edit ~/. byobu/keybindings.

How do I detach byobu session?

Try letting go of ctrl after the first a , so the sequence is ctrl - a , a , d .

What is a binding key?

Noun. key binding (plural key bindings) (computing) A key, or key combination, which, when pressed, causes something to happen. I changed the key binding for pause to the Escape key.


2 Answers

One way to change your key bindings is to edit /usr/share/byobu/keybindings/f-keys.tmux (or edit ~/.byobu/keybindings.tmux).

You will find these lines :

bind-key -n M-Left previous-window
bind-key -n M-Right next-window

M is for Meta, aka the ALT key. Example. Change the lines for :

bind-key -n C-Left previous-window
bind-key -n C-Right next-window

C for Ctrl key (and S for Shift key).

Save, quit, press F5 to reload profile.

Refs : Bybobu doc, Byobu-and-mc, keybindings-in-byobu-using-tmux-backend, tmux

like image 190
Eric Lavoie Avatar answered Oct 19 '22 06:10

Eric Lavoie


If the Function and other keys are bound to some other program, they won't work. Also, on some OS e.g CentOS, the keys (and their combinations) cease to function.

My solution is to use the bind-key which is Ctrl a to perform different actions. Here are a list of few important shortcuts with bind-key

Help
$ Ctrl-a ?

Create new window
$ Ctrl-a c

Horizontal split
$ Ctrl-a |     #Shift + \ = |

Vertical split
$ Ctrl-a %

Rename windows
$ Ctrl-a ,

Move window
$ Ctrl-a .

To move between splits (tested on RHEL)
$ Ctrl-a (arrow-keys)

NOTE: Tested on RHEL/CentOS

like image 2
Junaid Avatar answered Oct 19 '22 07:10

Junaid