I'm using tmux from a while and I'm very happy with it. Since I need it most of the time, I made it my default shell (in guake, to be precise).This is nice and I'm perfectly fine with this.But from time to time, I need to exit tmux and having a clean shell, but since I'm defaulted with tmux, terminating the session will result in another tmux later.So, my question is: is it possible to replace the tmux process with a given shell?Something like exec which, of course, doesn't work, because it replacess the shell inside tmux and not tmux itself.
Replacing tmux with exec
shell;tmux;guake
I don't think tmux can do that. It should be easy to patch if you know C programming.One thing you could do is call tmux from a wrapper shell script, and let the script decide whether to exit or not. Send a signal to the wrapper to tell it to execute an interactive shell when tmux exits. Here's an untested proof-of-concept for the wrapper script:export TMUX_PARENT_PID=$$trap 'exec bash -i' USR1tmuxIn ~/.tmux.conf:update-environment DISPLAY WINDOWID SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION TMUX_PARENT_PIDFrom within tmux, to get a shell prompt after detaching:TMUX_PARENT_PID=$(tmux show-environment | sed -n 's/^TMUX_PARENT_PID=//p')kill -USR1 $TMUX_PARENT_PIDtmux detach-client