bound widget return code lost #135
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.
zaw:20: permission denied:
now loading ...
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.
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.