Help setting z4h together with toggleterm.nvim
Closed this issue · 3 comments
I'm using z4h and toggleterm.nvim (through LunarVim) but toggling the terminal imediately exits my console app (alacritty).
I'm using start-tmux (so I can get the promt at the bottom) and I've seen this before with embedded terminals in VSCode and JetBrains. It has been enough to just fallback to a non-tmux zsh in those cases:
if [ "$TERMINAL_EMULATOR" = "toggleterm" ] || "$TERMINAL_EMULATOR" = "JetBrains-JediTerm" ] || [ "$TERMINAL_EMULATOR" = "VSCode" ]; then
zstyle ':z4h:' start-tmux no
zstyle ':z4h:' propagate-cwd yes
else
# Mark up shell's output with semantic information
zstyle ':z4h:' start-tmux command tmux -u new -A -D -t z4h
fi
But this is not enough for toggleterm for some reason. I also need to gate this line (which seems to do much of the magic):
z4h init || return
This is likely still tmux related, all the symptoms are the same: the console dies, tmux session is kept, and if I start my main session with start-tmux no
togglevim works.
Any ideas of what may be going on? Any tips on further troubleshooting it?
What happens if you remove this whole section with if-else-fi
? Does the terminal work? Are you missing any functionality?
Removing the if-else-fi
section works. And the prompt does stay at the bottom! That will do it, I set Alacritty to start tmux and now togglevim is happilly spawing zsh. Thanks much!
Curious: how is setting "start-tmux" to "no" and removing it altogether different? Prompt doesn't stay at the bottom using "no"
Curious: how is setting "start-tmux" to "no" and removing it altogether different? Prompt doesn't stay at the bottom using "no"
https://github.com/romkatv/zsh4humans/blob/master/tips.md#tmux
If you haven't seen this document, I highly recommend reading the whole thing and implementing as many tips as you can. The default z4h experience is gimped.