-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
zle widget based on insert-last-word
no longer works as expected
#748
Comments
Slight addendum: as the SO post notes, the same behavior can be achieved built-in by |
Thanks, this saved me time to figure out what was wrong with my shell. Disabling autosuggestions worked for me. My best guess is that something changed with zsh 5.9. This issue seems to have started happening with zsh 5.9, which is the default version of the latest macOS 14.4.1 (Sonoma) and is the latest version installed by Homebrew. In contrast, the latest one for Ubuntu 22.04 is zsh 5.8.1, which may be why we haven't seen many people complain yet. And with zsh 5.8, there's no issue. |
Describe the bug
I have the following widget defined and bound in my rc (copied from this stackoverflow post):
This used to work as expected: when pressing
alt + ,
(orescape ,
), zsh would insert the first word of the previous command. However, it now inserts the last word of the previous command (commonly^[.
, orinsert-last-word
(no argument)).To Reproduce
Steps to reproduce the behavior:
If you do the above in the reverse order (
bindkey
commands first, thensource
), you'll notice that the keybinds work as expected before thesource
.Expected behavior
As
man zshzle
indicates, this wrapper forinsert-last-word -- -1 1
should insert the first word of the previous command.Screenshots
Desktop
v0.6.0
,v0.5.0
,v0.4.0
,v0.3.0
Tested with
v0.2.0
as well, got:Additional context
I'm quite confused how this used to work in my config and doesn't anymore. I haven't updated plugins recently, but apparently I must have changed something seemingly unrelated in my config. Will keep looking, but not sure I'll be able to track down what the issue is myself.
I also tried
unset ZSH_AUTOSUGGEST_USE_ASYNC
andexport ZSH_AUTOSUGGEST_MANUAL_REBIND=1
(after sourcing the plugin), but neither of those seemed to make a difference.The text was updated successfully, but these errors were encountered: