From 908dac6152bf5c79eabe2eddcf757c1a944a963a Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Tue, 7 May 2013 17:15:06 -0500 Subject: [PATCH] * usr/bin/byobu-ctrl-a: LP: #1045070 - check if the user has already chosen an escape sequence and if so, don't bother them with the ctrl-a question --- debian/changelog | 3 +++ usr/bin/byobu-ctrl-a | 19 ++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index b4abee94..226faf6b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -28,6 +28,9 @@ byobu (5.38) unreleased; urgency=low on an off - useful when Shift-F12 is not usable (Linux console tty), and when ctrl-a-! is not usable (tmux) + * usr/bin/byobu-ctrl-a: LP: #1045070 + - check if the user has already chosen an escape sequence and if so, + don't bother them with the ctrl-a question [ Reinhard Tartler ] * usr/bin/byobu-reconnect-sockets, usr/lib/byobu/include/shutil: LP: #1162432 diff --git a/usr/bin/byobu-ctrl-a b/usr/bin/byobu-ctrl-a index f7017f42..883bc2b0 100755 --- a/usr/bin/byobu-ctrl-a +++ b/usr/bin/byobu-ctrl-a @@ -37,7 +37,24 @@ 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 "$BYOBU_BACKEND" in + "screen") + if grep -qs "^escape" "$keybindings"; then + # Check for escape definition in local keybindings config + bind_to="emacs" + fi + ;; + "tmux") + if grep -qs "^set -g prefix" "$keybindings"e; then + # Check for escape definition in local keybindings config + bind_to="emacs" + fi + # Check for some other escape sequence in tmux keys + if tmux list-keys | grep -qs "^bind-key\s\+[^a]\s\+send-prefix"; then + bind_to="emacs" + fi + ;; +esac case "${1}" in -h|--help) Usage; exit 0;;