From 0593b06dafb23cf2221f4b7622870f2bbb99ddbe Mon Sep 17 00:00:00 2001 From: tsi Date: Sat, 3 Jan 2026 01:29:07 +0100 Subject: [PATCH] Only try expansion when the self-insertion character is a shell meta-char --- bash-abbr | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bash-abbr b/bash-abbr index c4df275..7791ace 100644 --- a/bash-abbr +++ b/bash-abbr @@ -212,6 +212,13 @@ _try_abbrev_internal () { declare -r point line_until_point=${line::point} if + # Check if the self-insertion character is a shell metacharacter, except tab and newline (we don't want + # interactive alias expansion on tab and newline is represented as the empty self-insertion character) + case "$self_insertion" in + (["${_bash_meta_chars_without_tab_and_nl[*]}"]|'') ;; + (*) false + esac && + # Check if the character at point is a shell metacharacter or EOL # [[ $point -eq ${#line} || "${line:point:1}" = ["${_bash_meta_chars[*]}"] ]] && # NOTE: Above line commented out, it's actually not that useful.