* 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
This commit is contained in:
Dustin Kirkland 2012-01-28 12:26:19 -06:00
commit 46c72b8f0c
2 changed files with 8 additions and 1 deletions

3
debian/changelog vendored
View file

@ -4,6 +4,9 @@ byobu (5.6) unreleased; urgency=low
* usr/lib/byobu/ip_address: * usr/lib/byobu/ip_address:
- user@host and ipaddress need some separation, as they're hard to - user@host and ipaddress need some separation, as they're hard to
differentiate when next to one another 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 ] [ Ryan Thompson ]
* usr/bin/byobu-select-session: LP: #919391 * usr/bin/byobu-select-session: LP: #919391

View file

@ -34,6 +34,10 @@ bind_to=""
keybindings="$BYOBU_CONFIG_DIR/keybindings" keybindings="$BYOBU_CONFIG_DIR/keybindings"
touch "$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 case "${1}" in
-h|--help) Usage; exit 0;; -h|--help) Usage; exit 0;;
screen) bind_to="screen";; screen) bind_to="screen";;
@ -66,7 +70,7 @@ done
case "$bind_to" in case "$bind_to" in
emacs) 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 'bindkey "^A"' >> "$keybindings"
echo "INFO: ctrl-a will now operate in emacs mode" echo "INFO: ctrl-a will now operate in emacs mode"
echo > "$keybindings.tmux" echo > "$keybindings.tmux"