diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-08-17 16:06:14 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-08-17 16:06:14 -0500 |
commit | b0dca6bb7dfa2a651f99e38541cbc25a3dec19b7 (patch) | |
tree | 650eeb9217514e5f55fafbfe8989c2ae0c0799fa /etc | |
parent | 6841480804096e857e8bff57fd2b667099ea1412 (diff) | |
download | vyatta-cfg-b0dca6bb7dfa2a651f99e38541cbc25a3dec19b7.tar.gz vyatta-cfg-b0dca6bb7dfa2a651f99e38541cbc25a3dec19b7.zip |
Bugfix 7442: Check if running interactively before doing binding options
Diffstat (limited to 'etc')
-rwxr-xr-x | etc/bash_completion.d/vyatta-cfg | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index cacf365..9e9d652 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -638,14 +638,18 @@ reset_edit_level export VYATTA_COMP_LINE_EMPTY=VYATTA_COMP_LINE_EMPTY export VYATTA_COMP_LINE=$VYATTA_COMP_LINE_EMPTY -# readline bindings -bind 'set show-all-if-ambiguous on' -if ! bind -p |grep -q '\\C-x\\C-t'; then - bind '"\C-x\C-t": kill-region' -fi -if ! bind -p |grep -q '\\C-x\\C-o'; then - bind '"\C-x\C-o": copy-region-as-kill' -fi +# readline bindings +case "$-" in + *i*) + bind 'set show-all-if-ambiguous on' + if ! bind -p |grep -q '\\C-x\\C-t'; then + bind '"\C-x\C-t": kill-region' + fi + if ! bind -p |grep -q '\\C-x\\C-o'; then + bind '"\C-x\C-o": copy-region-as-kill' + fi + ;; +esac # note: now that we're using bash's new "empty completion" (-E), it becomes # necessary to capture the "default completion" (-D) as well in order to |