From 46c72b8f0ca72d670d891a379b90a8001ffc83ce Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sat, 28 Jan 2012 12:26:19 -0600 Subject: [PATCH] * usr/bin/byobu-ctrl-a: LP: #922951 - if the user has already chosen an escape sequence, don't run the interactive byobu-ctrl-a program --- debian/changelog | 3 +++ usr/bin/byobu-ctrl-a | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 2f059136..13612e28 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ byobu (5.6) unreleased; urgency=low * usr/lib/byobu/ip_address: - user@host and ipaddress need some separation, as they're hard to differentiate when next to one another + * usr/bin/byobu-ctrl-a: LP: #922951 + - if the user has already chosen an escape sequence, don't run the + interactive byobu-ctrl-a program [ Ryan Thompson ] * usr/bin/byobu-select-session: LP: #919391 diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index f4bed34c..98ad4fbf 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -34,6 +34,10 @@ bind_to="" keybindings="$BYOBU_CONFIG_DIR/keybindings" touch "$keybindings" +# If the user has already chosen an escape sequence, then +# presumably they want ctrl-a to operate in emacs mode +grep -qs "^escape" "$keybindings" && bind_to="emacs" + case "${1}" in -h|--help) Usage; exit 0;; screen) bind_to="screen";; @@ -66,7 +70,7 @@ done case "$bind_to" in emacs) - $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings" + $SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape escape \^Aa/d" "$keybindings" echo 'bindkey "^A"' >> "$keybindings" echo "INFO: ctrl-a will now operate in emacs mode" echo > "$keybindings.tmux"