diff --git a/debian/changelog b/debian/changelog index 1f130fd1..6776a305 100644 --- a/debian/changelog +++ b/debian/changelog @@ -15,6 +15,11 @@ byobu (4.46) unreleased; urgency=low usr/share/byobu/profiles/tmux: LP: #883637 - fix reconnection to SESSION_MANAGER and DBUS_SESSION_BUS_ADDRESS - add C-F5 key to tmux profile + * usr/bin/byobu-ctrl-a, usr/share/byobu/profiles/tmux: LP: #887387 + - support F12 as escape key in tmux mode + - reorder byobu-ctrl-a to offer screen first, then emacs mode + - make byobu-ctrl-a slighty more compatible with tmux (not quite + there yet...) -- Dustin Kirkland Mon, 31 Oct 2011 09:46:46 -0400 diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index 30ece658..86654d9e 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -46,8 +46,8 @@ while [ -z "$bind_to" ]; do echo "Configure Byobu's ctrl-a behavior..." echo echo "When you press ctrl-a in Byobu, do you want it to operate in:" - echo " (1) Emacs mode (go to beginning of line)" - echo " (2) Screen mode (GNU Screen's default escape sequence)" + echo " (1) Screen mode (GNU Screen's default escape sequence)" + echo " (2) Emacs mode (go to beginning of line)" echo echo "Note that:" echo " - F12 also operates as Screen escape in Byobu" @@ -58,29 +58,38 @@ while [ -z "$bind_to" ]; do s=$(head -n1) echo case "$s" in - 1) bind_to="emacs"; break;; - 2) bind_to="screen"; break;; + 1) bind_to="screen"; break;; + 2) bind_to="emacs"; break;; esac done case "$bind_to" in emacs) - $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" - echo 'bindkey "^A"' >> "$keybindings" - echo "INFO: ctrl-a will now operate in emacs mode" - ;; + $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" + echo 'bindkey "^A"' >> "$keybindings" + echo "INFO: ctrl-a will now operate in emacs mode" + echo > "$keybindings.tmux" + ;; screen) - $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" - echo 'escape "^Aa"' >> "$keybindings" - echo 'register x "^A"' >> "$keybindings" - echo 'bindkey "^A"' >> "$keybindings" - echo "INFO: ctrl-a will now operate in GNU Screen mode" - break - ;; - *) echo "Error: bad value for binding: $bind_to";; + $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" + echo 'escape "^Aa"' >> "$keybindings" + echo 'register x "^A"' >> "$keybindings" + echo 'bindkey "^A"' >> "$keybindings" + echo 'source /usr/share/doc/tmux/examples/screen-keys.conf' > "$keybindings.tmux" + echo "INFO: ctrl-a will now operate in GNU Screen mode" + break + ;; + *) + echo "Error: bad value for binding: $bind_to" + ;; +esac + +case "$BYOBU_BACKEND" in + screen) + $BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile" + ;; esac -$BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile" echo "To modify this behavior again later, run 'byobu-ctrl-a'" echo diff --git a/usr/share/byobu/profiles/tmux b/usr/share/byobu/profiles/tmux index a4259041..7c2fbc74 100644 --- a/usr/share/byobu/profiles/tmux +++ b/usr/share/byobu/profiles/tmux @@ -30,6 +30,9 @@ source /usr/share/doc/tmux/examples/screen-keys.conf # On Archlinux, this file is not under the same directory source /usr/share/tmux/screen-keys.conf +# Add F12 to the prefix list +set -g prefix ^A,F12 + # Byobu's Keybindings bind-key -n F1 new-window -k -t config byobu-config bind-key -n F2 new-window