zsh-autosuggestions icon indicating copy to clipboard operation
zsh-autosuggestions copied to clipboard

Manipulating file descriptors and triggering a parse error produces error

Open Iori-Pimentel opened this issue 1 year ago • 1 comments

Describe the bug

My .zshrc has a zshaddhistory hook that can cause this error message:

_zsh_autosuggest_async_request:zle:9: No handler installed for fd 12

To Reproduce

Steps to reproduce the behavior:

% zsh -df
% add-zsh-hook zshaddhistory hook
% hook() {
function> { exec {FD}>/dev/null } 2>/dev/null
function> }
% )
zsh: parse error near `)'
% )
_zsh_autosuggest_async_request:zle:9: No handler installed for fd 12

Expected behavior

No error message

Additional Context

Error message can be suppressed by adding 2>/dev/null to

		zle -F $_ZSH_AUTOSUGGEST_ASYNC_FD

Iori-Pimentel avatar Aug 20 '24 18:08 Iori-Pimentel