Skip to content

Commit 8926de0

Browse files
authored
Exclude the bind -x commands from interactive commands (#152)
* Exclude the `bind -x` commands from interactive commands * Check COMP_POINT instead of possibly empty COMP_LINE The check for COMP_LINE can fail because it can be empty in the completion function for the empty command line "complete -F _func -E".
1 parent 1f77dc0 commit 8926de0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bash-preexec.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,9 @@ __bp_preexec_invoke_exec() {
222222
return
223223
fi
224224

225-
if [[ -n "${COMP_LINE:-}" ]]; then
226-
# We're in the middle of a completer. This obviously can't be
227-
# an interactively issued command.
225+
if [[ -n "${COMP_POINT:-}" || -n "${READLINE_POINT:-}" ]]; then
226+
# We're in the middle of a completer or a keybinding set up by "bind
227+
# -x". This obviously can't be an interactively issued command.
228228
return
229229
fi
230230
if [[ -z "${__bp_preexec_interactive_mode:-}" ]]; then

0 commit comments

Comments
 (0)