29
[ -r "$HOME/.byoburc" ] && . "$HOME/.byoburc"
29
30
[ -z "${BYOBU_PREFIX}" ] && export BYOBU_PREFIX="/usr" || export BYOBU_PREFIX
30
. "${BYOBU_PREFIX}/lib/${PKG}/.common"
31
. "${BYOBU_PREFIX}/lib/${PKG}/include/common"
33
34
keybindings="$BYOBU_CONFIG_DIR/keybindings"
46
47
echo "Configure Byobu's ctrl-a behavior..."
48
49
echo "When you press ctrl-a in Byobu, do you want it to operate in:"
49
echo " (1) Emacs mode (go to beginning of line)"
50
echo " (2) Screen mode (GNU Screen's default escape sequence)"
50
echo " (1) Screen mode (GNU Screen's default escape sequence)"
51
echo " (2) Emacs mode (go to beginning of line)"
53
54
echo " - F12 also operates as Screen escape in Byobu"
54
55
echo " - You can press F9 and choose your escape character"
55
56
echo " - You can run 'byobu-ctrl-a' at any time to change your selection"
57
echo -n "Select [1 or 2]: "
58
printf "Select [1 or 2]: "
61
1) bind_to="emacs"; break;;
62
2) bind_to="screen"; break;;
62
1) bind_to="screen"; break;;
63
2) bind_to="emacs"; break;;
68
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
69
echo 'bindkey "^A"' >> "$keybindings"
70
echo "INFO: ctrl-a will now operate in emacs mode"
73
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
74
echo 'escape "^Aa"' >> "$keybindings"
75
echo 'register x "^A"' >> "$keybindings"
76
echo 'bindkey "^A"' >> "$keybindings"
77
echo "INFO: ctrl-a will now operate in GNU Screen mode"
80
*) echo "Error: bad value for binding: $bind_to";;
83
$BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile"
69
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
70
echo 'bindkey "^A"' >> "$keybindings"
71
echo "INFO: ctrl-a will now operate in emacs mode"
72
echo > "$keybindings.tmux"
75
$SED -i -e "/^register a /d" -e "/^bindkey \"^A\"/d" -e "/^escape /d" "$keybindings"
76
echo 'escape "^Aa"' >> "$keybindings"
77
echo 'register x "^A"' >> "$keybindings"
78
echo 'bindkey "^A"' >> "$keybindings"
79
echo "source /usr/share/doc/tmux/examples/screen-keys.conf" > "$keybindings.tmux"
80
echo "INFO: ctrl-a will now operate in GNU Screen mode"
84
echo "Error: bad value for binding: $bind_to"
88
case "$BYOBU_BACKEND" in
90
$BYOBU_BACKEND -X at 0 source "$BYOBU_CONFIG_DIR/profile"
84
94
echo "To modify this behavior again later, run 'byobu-ctrl-a'"