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
This commit is contained in:
re2zero 2026-05-27 11:56:58 +08:00
commit 3be7de77ac
4 changed files with 8 additions and 8 deletions

View file

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