Clip Man

daniele


Daniel Einspanjer's journal

Data warehousing, ETL, BI, and general hackery


Previous Entry Share Next Entry
Ubuntu screen-profiles customization
Clip Man
daniele
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:
  1. Open up the preferences dialog for Terminal.app
  2. Go to the Settings pane
  3. Click on the Keyboard tab button
  4. Edit the action for each of the F1 through F4 keys
  5. When editing, click the "delete one character" button twice to erase the characters currently in there (leave the \033 escape)
  6. Type the following characters: [ 1 1 ~ 11 is F1, 12 is F2, 13 is F3, 14 is F4
  7. 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:
  1. sudo cp /usr/share/screen-profiles/keybindings/common /usr/share/screen-profiles/keybindings/regions
  2. sudo vi /usr/share/screen-profiles/keybindings/regions
  3. replace the first four entries with the new entries below
  4. save and close the file
  5. In screen, hit F9 to bring up the menu
  6. Select the option for "Change keybinding set
  7. Select the new "regions" entry
  8. 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
Tags: ,

  • 1
Definitely, ubunty 9 having not the best keys set, 8.04 was better.

that's sad but...

(Anonymous)
I think thoses key problems are resolved in the 10.04 version

Re: that's sad but...

Yes, I've been using Byobu (the replacement for this original code), and it is much easier to reconfigure the keys and work with OSX now.

Byobu is fantastic and I recommend it to everyone who uses (or wants to use) screen.

  • 1
?

Log in

No account? Create an account