diff --git a/byobu-config b/byobu-config index e9576d30..830266ba 100755 --- a/byobu-config +++ b/byobu-config @@ -148,7 +148,9 @@ def profile(screen, size): def keybindings(screen, size): li = Listbox(height = 6, width = 60, returnExit = 1) for choice in commands.getoutput('ls '+SHARE+'/keybindings').splitlines(): - li.append(choice, choice) + if choice != "common" and choice != "none": + li.append(choice, choice) + li.append("none", "none") bb = ButtonBar(screen, ((_("Apply"), "apply"), (_("Cancel"), "cancel", ESC)), compact = 1) g = GridForm(screen, _("Which set of keybindings would you like to use?"), 1, 2) g.add(li, 0, 0, padding=(4,2,4,2)) diff --git a/debian/changelog b/debian/changelog index ae93fb6f..b8b7747e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -40,7 +40,13 @@ byobu (2.12) unreleased; urgency=low * byobu-config: have ESC be a hotkey for 'cancel', LP: #373473 - -- Dustin Kirkland Wed, 17 Jun 2009 11:07:18 -0500 + * byobu-config, debian/rules, keybindings/common.disable, + keybindings/f-keys, keybindings/screen-escape-keys: massive fix for + byobu keybindings; use ctrl-a-! to toggle on/off byobu's f-keys; + also support a new keyset, screen-escape-keys which profiles ctrl-a + keybindings for common byobu functions, LP: #380944 + + -- Dustin Kirkland Wed, 17 Jun 2009 14:17:15 -0500 byobu (2.11-0ubuntu1) karmic; urgency=low diff --git a/debian/rules b/debian/rules index 2cb0cc9d..6b339835 100755 --- a/debian/rules +++ b/debian/rules @@ -49,6 +49,7 @@ install: build install-po dh_testroot dh_clean -k dh_link usr/bin/byobu-status usr/bin/screen-profiles-status + dh_link usr/share/byobu/keybindings/f-keys usr/share/byobu/keybindings/common dh_install -X.bzr # Everything else is handled by dh_install diff --git a/keybindings/common.disable b/keybindings/common.disable deleted file mode 100644 index d9bf6eaf..00000000 --- a/keybindings/common.disable +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################### -# Disable Byobu's common keybindings -# This configuration profile is intended to be a common header of useful -# keybindings, included by other profiles. -# -# Copyright (C) 2008 Nick Barcet -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, version 3 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . -############################################################################### - -# This file disables the common key bindings - -bindkey -k k2 -bindkey -k k3 -bindkey -k k4 -bindkey -k k5 -bindkey -k k6 -bindkey -k k7 -bindkey -k k8 -bindkey -k k9 -bindkey -k F2 -bind $ -bind @ -bind R diff --git a/keybindings/common b/keybindings/f-keys similarity index 68% rename from keybindings/common rename to keybindings/f-keys index 9423fbda..c2b6aa03 100644 --- a/keybindings/common +++ b/keybindings/f-keys @@ -1,9 +1,10 @@ ############################################################################### -# GNU Screen common keybindings -# This configuration profile is intended to be a common header of useful -# keybindings, included by other profiles. +# Byobu f-key keybindings +# This configuration profile is intended to provide a useful +# keybindings using the keyboard's f-keys # # Copyright (C) 2008 Nick Barcet +# Dustin Kirkland # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,21 +19,9 @@ # along with this program. If not, see . ############################################################################### -# This file defines the common key bindings -# -# For a keybinding to live in the "common" area, it must be verified to -# work in at least: -# * gnome-terminal -# * console tty -# -# bindkey commands should be followed by a comment that will be used in the -# help file (one day). The command should be formated as: -# # | explanation - # F-keys seem to work well in both gnome-terminal and tty consoles # F1 | 'help' in gnome-terminal -register n "^a^c" # | Goes with the F2 definition -bindkey -k k2 process n # F2 | Create new window +bindkey -k k2 screen # F2 | Create new window bindkey -k k3 prev # F3 | Previous Window bindkey -k k4 next # F4 | Next Window register r "^a:source $HOME/.byobu/profile^M" # | Goes with F5 definition @@ -49,9 +38,6 @@ bind $ screen -t status 0 byobu-status-detail # ctrl-a $ | show detailed statu bind @ screen -t help 0 byobu-config # ctrl-a @ | Configuration bind R process r # ctrl-a R | Reload profile -# toggle common keybindings off -register d "^a:source /usr/share/byobu/keybindings/common.disable^M" -bind ) process d -# toggle common keybindings on -register e "^a:source /usr/share/byobu/keybindings/common^M" -bind ( process e +# toggle f-key keybindings off +register d "^a:source /usr/share/byobu/keybindings/screen-escape-keys^M" +bind ! process d diff --git a/keybindings/none b/keybindings/none deleted file mode 100644 index a9a29e93..00000000 --- a/keybindings/none +++ /dev/null @@ -1 +0,0 @@ -# This is intended to be a completely empty set of keybindings diff --git a/keybindings/screen-escape-keys b/keybindings/screen-escape-keys new file mode 100644 index 00000000..f6c40ee2 --- /dev/null +++ b/keybindings/screen-escape-keys @@ -0,0 +1,52 @@ +############################################################################### +# Disable Byobu's f-key keybindings, define a set using screen's escape +# sequence. +# +# Copyright (C) 2009 Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +############################################################################### + +# This file disables the f-key bindings, but retains the +# keybindings that use screen's built-in escape sequence + +# Disable the f-key bindings +bindkey -k k2 +bindkey -k k3 +bindkey -k k4 +bindkey -k k5 +bindkey -k k6 +bindkey -k k7 +bindkey -k k8 +bindkey -k k9 +bindkey -k F2 + +# Use the following sequences for byobu functionality +# SEQUENCE ACTION F-Key equivalent +# ctrl-a-c Create a new window F2 +# ctrl-a-p Previous window F3 +# ctrl-a-n Next window F4 +# ctrl-a-R Reload profile F5 +register r "^a:source $HOME/.byobu/profile^M" +bind R process r +# ctrl-a-d Detach from this session F6 +# ctrl-a-[ Enter copy/scrollback mode F7 +# ctrl-a-A Re-title a window F8 +# ctrl-a-@ Configuration F9 +bind @ screen -t help 0 byobu-config +# ctrl-a-x Lock this terminal F12 +# ctrl-a-$ Show detailed status +bind $ screen -t status 0 byobu-status-detail +# ctrl-a-! Toggle f-key keybindings on +register e "^a:source /usr/share/byobu/keybindings/f-keys^M" +bind ! process e