I have configured my Tmux to open with i open terminal by modifying the .zshrc file.
[[ -z "$TMUX" ]] && tmux -u
It worked fine, now I want to close the tmux session when I close my terminal.
I tried using this:
trap 'tmux kill-session -t "$TMUX_PANE"' EXIT
But it doesn't work.
I am expecting a bash command that would be placed in .zshrc file to close the tmux session along with the terminal.
Thank you in advance.
bash
, but mentioned.zshrc
; you are expecting "a bash command that would be placed in.zshrc
". This file is for zsh, not for bash. What shell do you use inside tmux? What shell do you use outside of tmux? Please edit and do not confuse both shells. If they are both involved somehow then you need to clarify this.