I recently loaded Ubuntu server 9.04 onto a new machine and encountered Ubuntu's screen-profiles.
In general, I like it. I had one problem and one customization that I wanted to share:
I use Mac OS X's Terminal.app to connect to my remote machines, and by default, it has custom mappings for F1 through F4. I have no idea what those keybindings mean, but they prevent screen-profiles's keybindings from working. It took a little fiddling to figure out how to fix them. Basically, you need to:
- Open up the preferences dialog for Terminal.app
- Go to the Settings pane
- Click on the Keyboard tab button
- Edit the action for each of the F1 through F4 keys
- When editing, click the "delete one character" button twice to erase the characters currently in there (leave the \033 escape)
- Type the following characters: [ 1 1 ~ 11 is F1, 12 is F2, 13 is F3, 14 is F4
- The new entries should look just like the F5 through F8 actions.
Once I was able to use the F2 F3 and F4 keys, I decided that they weren't that useful to me. I prefer to use a combination of screen regions and windows. The window commands are very easy for me, but I've always found the split, focus, and remove keybindings to be uncomfortable so I figured those would be great commands to map to F2 F3 and F4. Here is how I did that:
- sudo cp /usr/share/screen-profiles/keybindings/common /usr/share/screen-profiles/keybindings/regions
- sudo vi /usr/share/screen-profiles/keybindings/regions
- replace the first four entries with the new entries below
- save and close the file
- In screen, hit F9 to bring up the menu
- Select the option for "Change keybinding set
- Select the new "regions" entry
- Hit F5 to reload your screen-profile and pick up the new keybindings.
register n "^aS^a^i^a^c^aA" # | Goes with the F2 definition
bindkey -k k2 process n # F2 | Create new region and window (and name it)
bindkey -k k3 focus # F3 | Next region
bindkey -k k4 remove # F4 | Remove region