zsh-users / zsh-autosuggestions

Fish-like autosuggestions for zsh
MIT License
30.79k stars 1.85k forks source link

Problem with <Control-D> and IGNORE_EOF #139

Open OmeGak opened 8 years ago

OmeGak commented 8 years ago

I've been facing a problem with IGNORE_EOF recently and I found it was caused by zsh-autosuggestions. I've been getting this on <Control-D>:

<Control-D>
zsh: do you wish to see all 3221 possibilities (3221 lines)?

Instead of the usual:

<Control-D>
zsh: use 'logout' to logout.

This is the minimal configuration in .zshrc to reproduce the issue:

source "$DOT/zsh/.antigen/antigen.zsh"
antigen bundle zsh-users/zsh-autosuggestions
antigen apply
setopt ignore_eof

I managed to walk around the issue binding ^D to beep, but it seems like a bug to me.

ericfreese commented 8 years ago

Looks like this has something to do with ctrl+d being bound to a widget that overrides the delete-char-or-list builtin widget:

% zsh -f
%% setopt ignore_eof
%% bindkey '^D'
"^D" delete-char-or-list
%% <Control-D>
zsh: use 'exit' to exit.
%% delete-char-or-list() { zle .delete-char-or-list }
%% zle -N delete-char-or-list
%% <Control-D>
zsh: do you wish to see all 1782 possibilities (594 lines)?
%% bindkey '^D' .delete-char-or-list
%% <Control-D>
zsh: use 'exit' to exit.
ericfreese commented 8 years ago

Comment in the zle code confirms:

/*
 * The rule is that "zle -N" widgets suppress EOF warnings.  When
 * a "zle -N" widget invokes "zle another-widget" we pass through
 * this code again, but with actual arguments rather than with the
 * zlenoargs placeholder.
 */

Not sure how to fix this right now. At some point, I'll dig into the execzlefunc function with gdb and see if I can get more insights on how this all fits together.

avatar-lavventura commented 4 years ago

For both I keep getting following output: zsh: do you wish to see all 2319 possibilities (773 lines)?

chbndrhnns commented 2 years ago

This is still an issue for me on an M1 mac 5 years later.

RobThree commented 1 year ago

Same for me; somehow this started happening about a week or two ago (I updated to Ventura, but I'm not sure it coincides with that) and I have no idea what to do.

elliotwutingfeng commented 1 week ago

I'm getting this recently on Manjaro and Ubuntu. Seems to only affect systems accessed via ssh.

EDIT: After some digging around it appears to be a bug with libssh (https://gitlab.com/libssh/libssh-mirror/-/issues/270). Can be observed when using ssh via Remmina or PuTTY. So my issue is probably not the zsh-autosuggestions plugin.