Comment 27 for bug 482623

Revision history for this message
Dustin Keeler (fishfilet) wrote :

I don't know if this is still open or not as it has been a while since the last comment.

I did have a few things to add that may be related to some of the problems described.

First I have a Macbook Pro about 5 years old now. While there are function keys they do not operate as function keys by default. Instead they are used to control the screen brightness, volume, keyboard backlight, etc. To use them as function keys you have to hold down the fn key next to the left control key as mentioned in an earlier comment. This can however be changed in "System Preferences > Keyboard". Just check the box that says "Use all F keys as standard function keys". If you do this then the behavior is reversed. All function keys work like function keys and if you use the fn key next to the left control key they will then operate screen brightness, sound, etc.

In addition to knowing about this setting and it's effect you also may need to disable some Keyboard shortcuts as the operating system may be using them. This is done again under "System Preferences > Keyboard" under the Keyboard Shortcuts tab.

The last thing is this. I was able to use F2 to open a new window but I could not split the window with Shift-F2 or Control-F2. This drove me mad until I found a setting to fix this. I use the built in terminal app in OSX. If you go to the preferences menu in the terminal app you will see a few buttons at the top. Under the settings button there are a few sub sections on the right side such as "Text, Window, Shell, Keyboard, Advanced". Go to the Keyboard section and you will see a list of keys and the action they are mapped to. For me the F2 key was mapped to \033OQ. I noticed though that there was no mapping for Shift-F2 or Control-F2. This must be my issue right?

So I found a byobu config file at /usr/share/byobu/keybindings/f-keys.screen. In this file I found that Shift-F2 was expecting O1;2Q and Control-F2 was expecting O1;5Q. The ^[ is the escape key which in the terminal app is \033.

So I then added the mappings in the terminal app so that Shift-F2 was \033O1;2Q and Control-F2 was \033O1;5Q. After doing that I could now split windows.

So it seems that for some reason the apple terminal app simply did not send the sequence byobu was expecting. There may be other keys as well that you need to map in the terminal app. I assume that other terminal applications may have similar settings that need to be configured.

While this may not be relevant I have to ask. How can I find out what sequence a program is expecting? While I found this f-keys.screen file for byobu I have not been able to find out the information I need for other programs. For instance tmux without byobu. Is there an all inclusive list of what sequence a key should send somewhere? For instance I need to know what to send for Control-Left, Control-Right, Alt-Left, Alt-Right and others.