Fix bug where alias could contain < or >

This commit is contained in:
tsi 2025-12-25 20:43:59 +01:00
parent d241bfda6a
commit 30540f0bbf
No known key found for this signature in database

View file

@ -210,6 +210,9 @@ _try_abbrev_internal () {
# But < and > are ignored, since they always expect a file/delimiter/string afterwards and not a command
declare -r word_at_point=${line_until_point##*[&;()|[:space:]]} &&
# Ensure that word does not contain either < or >
[[ ! $word_at_point =~ [\<\>] ]] &&
# Select replacement (if any)
declare replacement=${BASH_ALIASES["${word_at_point:-__nonexistent}"]-} &&