Cannot save when using zsh
Hi guys,
I am using tmux with zsh on Linux Mint. When I try to save it, I get this error:
❯ ^[[4~ fc -R '/home/mpeck/.tmux/resurrect/zsh_history-0:1.1' [16:15:13]
zsh: substitution failed
>>> elapsed time 35s
If add below line to my zshrc:
#bindkey "^u" backward-kill-line
Then I get this when saving the session:
mpeck@vm-mint64 ~
❯ fc -lLn -64 > '/home/mpeck/.tmux/resurrect/zsh_history-0:1.1' [18:51:18]
zsh: file exists: /home/mpeck/.tmux/resurrect/zsh_history-0:1.1
✘ mpeck@vm-mint64 ~
❯ fc -R '/home/mpeck/.tmux/resurrect/zsh_history-0:1.1' [18:51:18]
mpeck@vm-mint64 ~
❯
So..2 errors..one is the > when the file exists with zsh. The other one is the print out to console of the read command.
Any ideas how to fix both?
Same issue here.
Ping @marianopeck
same issue here.
I also face the same issue. Seems to be caused by zprezto modules. I could solve the first issue by putting this in my zshrc:
bindkey "^E" end-of-line # Map end-of-line key in the same way as zprezto editor module to prevent issue with tmux-resurrect.
The editor module seems to make keybindings for different modes. The end-of-line binding for viins conflicts here. So by adding the same binding which is then also retrieved by tmux-resurrect solves the issue.
The file write issue can be solved by putting this in zshrc:
setopt CLOBBER # Allow pipe to existing file. Prevent issue with history save in tmux-resurrect.
The cleaner way maybe would be that save.sh in resurrect would use force here:
local history_w='fc -lLn -64 >!'
Thanks @mstaz - this is the first concrete workaround I see in many months!