-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bound widget return code lost #135
Comments
You are right that the return code of the original widget is not being correctly returned, but I have yet to personally find a case where it's needed, and I'm having trouble reproducing the error you're describing. I'm not familiar with zaw, and I honestly don't understand what the point of it is, but this is what I've tried: % zsh -f
%% source ~/.zsh/zsh-autosuggestions.zsh
%% source ~/.zsh/zaw/zaw.zsh
%% bindkey '^R' zaw-select-src
%% bindkey '^G'
"^G" send-break
# I then press '^R' to invoke zaw-select-src.
# After the select source menu comes up, I press '^G' to issue a send-break.
# Zaw exits and I'm returned to the prompt. All seems fine. Can you give a clearer description of what exact problem you're having? |
Sure. WIth zaw sourced, you press CTRL-x followed by semicolon to start the zaw widget. Zaw itself then invokes the zaw-select-src widget, which is what draws and filters the menu. This widget will then exit if you press CTRL-g (send-break) or hit enter and return control back to the zaw widget. If you've hit CTRL-g or hit enter without matching anything then zaw-select-src will return 1 indicating to zaw that there's no match and there's nothing else to do. However, with the widget bound, zaw-select-src always returns 0, and zaw thinks that there's a match and that there's something to execute which results in the following error because it's trying to execute a command that's just an empty string.
You can see zaw calling zaw-select-src and checking the return code in zaw.zsh at around line 80. I imagine that there's probably other use cases where having the return code is necessary. |
Awesome, thanks for all the detailed info! I'll fix this soon. |
Keep track of return value from original widget (#135)
Went ahead and merged. Should be fixed with the release of 0.3.2 |
For a bound widget, the return code of the invocation of the original widget is not returned.
This a problem with zaw where the zaw-select-src widget will return 1 in the event a send-break is issued or if there are no matches, telling zaw to exit.
The text was updated successfully, but these errors were encountered: