I've used this snippet to launch tmux when the terminal is launched:
# TMUX startup
if command -v tmux>/dev/null; then
[[ ! $TERM =~ screen ]] && [ -z $TMUX ] && exec tmux
fi
But with this I can't exit tmux without the terminal screen being closed too.
I've tried:
Ctrl + b :detach
exit
And looking for the PID and killing it. All those methods close the terminal too.
How should I configure tmux to start when launching the terminal but still being able to close it without the terminal closing? Any tips are appreciated!
tmux
works, but I get a:sessions should be nested with care, unset $TMUX to force
. I've also tried leaving the snipped I used as it is and adding atmux
at the end of the~/.bashrc
but then detaching still exits the terminal. – bpinaya Feb 19 '19 at 10:37