Hi,
I have Ctrl-Space as bindkey for autosuggest-accept.
If I start tmux, Ctrl-Space stops working.
If I source ~/.zshrc, then the shortcut works.
I'm looking for a way to get the shortcut to work inside a tmux session without manual commands.
Anyone here using both autosuggestions and tmux?
Thanks
Hi, does it work if you bind ctrl-space to a different widget?
bindkey '^@' self-insert
Then press ctrl-space. Does it insert ^@ into the buffer?
Apologies, I missed the notification for the answer.
I'm getting the same result with the above bindkey.
^@ is inserted, then I start tmux and it's no longer working, until I reload zsh config.
Ok thanks for following up. It sounds like this is just an issue with tmux and doesn’t have much to do with this plugin. I would try googling something like “tmux ctrl space” for further help.
I have the same problem and it does not matter what keybindings I assign to autosuggest-accept.
Currently, I source the zsh config every time I start a new tmux session. However, I think this not really a good workaround as it slows down startup time.
I've figured this out. The problem for me was that I was putting my bindkey '^\' autosuggest-excute statement right after plugins+=(zsh-autosuggestions) (to keep everything together), which is before the source $ZSH/oh-my-zsh.sh line. It seems that sourceing oh-my-zsh.sh somehow overwrites all previous bindkey statements (though I still don't know why re-sourceing temporarily fixes the problem). The solution is to move your bindkey statement below the source $ZSH/oh-my-zsh.sh line.
Thank you so much @samm81, this was indeed the solution!
Most helpful comment
I've figured this out. The problem for me was that I was putting my
bindkey '^\' autosuggest-excutestatement right afterplugins+=(zsh-autosuggestions)(to keep everything together), which is before thesource $ZSH/oh-my-zsh.shline. It seems thatsourceingoh-my-zsh.shsomehow overwrites all previousbindkeystatements (though I still don't know why re-sourceing temporarily fixes the problem). The solution is to move yourbindkeystatement below thesource $ZSH/oh-my-zsh.shline.