zsh-autosuggestions/src/util.zsh
re2zero 3be7de77ac Use builtin echo to avoid conflicts with user aliases
When users have an alias or function that shadows 'echo', it can break
autosuggestions by either printing wrong suggestions or executing
unwanted functions. This commit replaces all 'echo' calls with
'builtin echo' to ensure the shell's built-in echo is always used.

Fixes: #843
2026-05-27 11:56:58 +08:00

11 lines
409 B
Bash

#--------------------------------------------------------------------#
# Utility Functions #
#--------------------------------------------------------------------#
_zsh_autosuggest_escape_command() {
setopt localoptions EXTENDED_GLOB
# Escape special chars in the string (requires EXTENDED_GLOB)
builtin echo -E "${1//(#m)[\"\'\\()\[\]|*?~]/\\$MATCH}"
}