mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2026-06-16 16:39:49 +02:00
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
11 lines
409 B
Bash
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}"
|
|
}
|