I've been trying to bind a shortcut to switching to a specific window in Byobu, but I'm not having success. I wanted to bind Alt-(screen's number) but it's not working. I think I'm using the wrong ASCII codes.
Take Alt + 1 for example: I've tried using the lines
bind \078 select 1
and
bind \78 select 1
to both ~/.screeenrc
and ~/.config/byobu/keybindings
, but neither worked.
Am I using the wrong code, or is there no standard ASCII code for Alt + 1?
Best Answer
First check what octal code is generated when you press alt+1, type in the following:
(If that makes no sense to you: instead of writing C-q, press ctrl-q and for M-1 substitute alt-1, and some character should show up). For example, I have Finnish keyboard and en_US.UTF-8 locale and get:
so I put in my .screenrc:
Note: by default this will not work in a gnome-terminal at all, since alt+number changes the tab and screen (or bash) doesn't get a chance to see the keypress. Go to
Edit > Keyboards Shortcuts...
to change the shortcuts.