From e80ba03ab7e853c4f7c7cbc4b64e9f44ae8166b8 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Wed, 4 May 2011 00:43:18 -0500 Subject: [PATCH] * usr/bin/byobu-config, usr/share/byobu/keybindings/f-keys, usr/share/byobu/keybindings/screen-escape-keys, usr/share/doc/byobu/help.txt: LP: #776743 - use ASCII 16 (data link escape) as the escape character - bind F12 to printing the escape character - adjust everything accordingly --- debian/changelog | 7 +++++- usr/bin/byobu-config | 2 +- usr/share/byobu/keybindings/f-keys | 25 +++++++++++-------- .../byobu/keybindings/screen-escape-keys | 3 +++ usr/share/doc/byobu/help.txt | 3 +-- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1193cf12..37d48f1d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,11 @@ byobu (3.35) unreleased; urgency=low - * UNRELEASED + * usr/bin/byobu-config, usr/share/byobu/keybindings/f-keys, + usr/share/byobu/keybindings/screen-escape-keys, + usr/share/doc/byobu/help.txt: LP: #776743 + - use ASCII 16 (data link escape) as the escape character + - bind F12 to printing the escape character + - adjust everything accordingly -- Dustin Kirkland Tue, 03 May 2011 12:11:10 -0500 diff --git a/usr/bin/byobu-config b/usr/bin/byobu-config index cb52a725..31fe651d 100755 --- a/usr/bin/byobu-config +++ b/usr/bin/byobu-config @@ -484,7 +484,7 @@ def setesckey(key): out = commands.getoutput(SED+" -i -e 's/^register.*$//' "+path) out = commands.getoutput("grep -h ^register "+SHARE+"/keybindings/*keys") appendtofile(path, out+"\n") - out = commands.getoutput(SED+" -i -e 's/\"\^a/\"\^"+l+"/g' "+path) + out = commands.getoutput(SED+" -i -e 's/\"\\020/\"\^"+l+"/g' "+path) out = commands.getoutput(SED+" -i -e '/^$/d' "+path) def chgesc(screen, size): diff --git a/usr/share/byobu/keybindings/f-keys b/usr/share/byobu/keybindings/f-keys index eb3f5d58..2f07066b 100644 --- a/usr/share/byobu/keybindings/f-keys +++ b/usr/share/byobu/keybindings/f-keys @@ -19,27 +19,32 @@ # along with this program. If not, see . ############################################################################### +# Byobu's escape key is ASCII Dec:16, Hex:10, Oct:020, Char:DLE -- Data link escape +# which is bound to F12 +escape \020\020 + # F-keys seem to work well in both gnome-terminal and tty consoles bindkey -k k1 screen -t config 0 byobu-config # F1 | Configuration (along with F9) # | since F1 = Help in gnome-terminal bindkey -k k2 screen # F2 | Create new window bindkey -k k3 eval 'prev' 'fit' # F3 | Previous Window bindkey -k k4 eval 'next' 'fit' # F4 | Next Window -register r "^a:source $HOME/.byobu/profile^M" # | Goes with F5 definition +register r "\020:source $HOME/.byobu/profile^M" # | Goes with F5 definition bindkey -k k5 eval 'process r' # F5 | Reload profile bindkey -k k6 detach # F6 | Detach from this session bindkey -k k7 copy # F7 | Enter copy/scrollback mode -register t "^aA^aa^k^h" # | Goes with the F8 definition +register t "\020A\020a^k^h" # | Goes with the F8 definition bindkey -k k8 process t # F8 | Re-title a window bindkey -k k9 screen -t config 0 byobu-config # F9 | Configuration # F10 | 'toolbar' in gnome-terminal # F11 | 'fullscreen' in gnome-terminal -bindkey -k F2 lockscreen # F12 | Lock this terminal -bind $ screen -t status 0 byobu-status-detail # ctrl-a $ | show detailed status -bind @ screen -t config 0 byobu-config # ctrl-a @ | Configuration -bind R process r # ctrl-a R | Reload profile -register s "^a[g G$>^h" # Goes with ^a~ definition -bind ~ eval 'process s' 'exec sed -i -e "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # ctrl-a ~ | write the buffer to file +register x "\020" # | Goes with the F12 definition +bindkey -k F2 process x # F12 | Screen's escape key +bind $ screen -t status 0 byobu-status-detail # F12 $ | show detailed status +bind @ screen -t config 0 byobu-config # F12 @ | Configuration +bind R process r # F12 R | Reload profile +register s "\020[g G$>^h" # Goes with \020~ definition +bind ~ eval 'process s' 'exec sed -i -e "/./,/^$/!d" /var/run/screen/S-$USER/byobu-exchange' 'echo "See: /var/run/screen/S-$USER/byobu-exchange"' # F12 ~ | write the buffer to file # Hotkeys for splits (gnome-terminal) bindkey "^[O1;2Q" eval 'split' 'focus down' 'next' 'focus up' # shift-F2 | horizontal split @@ -68,5 +73,5 @@ bindkey "^[[15;5~" eval 'process r' 'stuff ". $BYOBU_PREFIX/bin/byobu-reconnect- bindkey "^[[17;2~" eval 'exec touch /var/run/screen/S-$USER/byobu.no-logout' 'detach' # ctrl-F6 | detach, but don't logout # toggle f-key keybindings off -register d "^a:source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M" -bind ! eval 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' # ctrl-a-! | toggle on/off f-keys +register d "\020:source $BYOBU_PREFIX/share/byobu/keybindings/screen-escape-keys^M" +bind ! eval 'process d' 'backtick 111 9999999 9999999 byobu-status menu --disable-f-keys' # F12 ! | toggle on/off f-keys diff --git a/usr/share/byobu/keybindings/screen-escape-keys b/usr/share/byobu/keybindings/screen-escape-keys index 142e4da6..9598beb3 100644 --- a/usr/share/byobu/keybindings/screen-escape-keys +++ b/usr/share/byobu/keybindings/screen-escape-keys @@ -20,6 +20,9 @@ # This file disables the f-key bindings, but retains the # keybindings that use screen's built-in escape sequence +# Default screen escape +escape ^Aa + # Disable the f-key bindings bindkey -k k2 bindkey -k k3 diff --git a/usr/share/doc/byobu/help.txt b/usr/share/doc/byobu/help.txt index f3fbf0eb..0cdba33d 100644 --- a/usr/share/doc/byobu/help.txt +++ b/usr/share/doc/byobu/help.txt @@ -6,6 +6,5 @@ F2 Create a new window | F6 Detach from the session F3 Go to the prev window | F7 Scrollback and search F4 Go to the next window | F8 Rename a window F5 Reload profile | F9 Configuration - | F12 Lock this terminal -'screen -r' - reattach | > Escape sequence +'screen -r' - reattach | F12 Screen escape sequence 'man screen' - screen's help | 'man byobu' - byobu's help