marlonrichert / zsh-autocomplete

🤖 Real-time type-ahead completion for Zsh. Asynchronous find-as-you-type autocompletion.
MIT License
5.36k stars 149 forks source link

Terminal quits when using <S-Tab> to complete in menu-select #274

Closed yutkat closed 3 years ago

yutkat commented 3 years ago
$ git -C ~zsh-autocomplete switch main  # Make sure you test with the `main` branch.
$ git -C ~zsh-autocomplete pull         # Update to the latest commit.
$ cd $(mktemp -d)                       # Create a temp dir and enter it.
$ unset _comp_dumpfile ZDOTDIR XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME
$ HOME=$PWD exec zsh -f       # Restart Zsh without config files in this dir.
% zstyle ':autocomplete:*' widget-style menu-select
% source /path/to/zsh-autocomplete/zsh-autocomplete.plugin.zsh
% ls /
<Shift-Tab> to go back to the previous candidate.
And you press <Shift-Tab> again.
Terminal emulator suddenly quits

According to my investigation, this problem seems to occur from the commit of fbd093f7c97a64da92020ba5a6c2756ff56e1c9d.

tanderson-google commented 3 years ago

I'm also seeing this issue. It seems to be a crash in zsh.

marlonrichert commented 3 years ago

Fixed.

yutkat commented 3 years ago

Thank you for the update. But, I've tried the main branch and it still seems to reproduce.

tomKPZ commented 3 years ago

Same here, the issue still reproduces. Here's a stack trace: https://pastebin.com/TgK4Ajd0

marlonrichert commented 3 years ago

OK, yes, I can reproduce it, too. Let me have another look.

marlonrichert commented 3 years ago

Looks like a bug in Zsh to me: https://www.zsh.org/mla/workers/2021/msg01162.html

yutkat commented 3 years ago

Oh! it's a bug in zsh. I'm surprised. Indeed, the following steps reproduced the problem in my environment.

Steps to reproduce:

zmodload zsh/complist
tst() { compadd bar baz; compstate[insert]=1 }
zle -C tst menu-select tst
bindkey '^I' tst
bindkey -M menuselect '^[[Z' reverse-menu-complete
ba^I^[[Z

But why doesn't it reproduce with fbd093f commit? I want you to revert this commit if possible.

marlonrichert commented 3 years ago

Don't worry, I already know how to work around this. I will commit a fix later today. 🙂

marlonrichert commented 3 years ago

All right, now it should really be fixed. 🙂

yutkat commented 3 years ago

Great work :tada: It works for me. Thank you, marlonrichert.