mirror of
https://github.com/zsh-users/zsh-autosuggestions.git
synced 2024-11-18 09:51:06 +01:00
Fix error when single quote entered into buffer
Error looked something like: ``` % echo 'f(zpty):8: unmatched ' _zsh_autosuggest_capture_completion:zpty:9: no such pty command: zsh_autosuggest_completion_pty _zsh_autosuggest_capture_completion:zpty:14: no such pty command: zsh_autosuggest_completion_pty _zsh_autosuggest_capture_completion:zpty:21: no such pty command: zsh_autosuggest_completion_pty ``` According to `man zshmodules`, the args to `zpty` are "concatenated with spaces between, then executed as a command, as if passed to the eval builtin." So we need to escape the `$` so that `$1` is passed to eval instead of the value of `$1`.
This commit is contained in:
parent
43a011026f
commit
1ec43c7291
2 changed files with 2 additions and 2 deletions
|
@ -94,7 +94,7 @@ _zsh_autosuggest_capture_completion() {
|
|||
if zle; then
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME zle autosuggest-capture-completion
|
||||
else
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME "_zsh_autosuggest_capture_buffer '$1'"
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME _zsh_autosuggest_capture_buffer "\$1"
|
||||
zpty -w $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME $'\t'
|
||||
fi
|
||||
|
||||
|
|
|
@ -593,7 +593,7 @@ _zsh_autosuggest_capture_completion() {
|
|||
if zle; then
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME zle autosuggest-capture-completion
|
||||
else
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME "_zsh_autosuggest_capture_buffer '$1'"
|
||||
zpty $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME _zsh_autosuggest_capture_buffer "\$1"
|
||||
zpty -w $ZSH_AUTOSUGGEST_COMPLETIONS_PTY_NAME $'\t'
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue