I have noticed that a logoff (log out) from my X user session will kill any tmux session I have initiated, even sessions I had run with sudo tmux and similar commands. I am sure that this formerly did not happen, but some recent change has effected this behavior.

How do I maintain these tmux (or screen) sessions, even after I end my X session?


This "feature" has existed in systemd previously, but the systemd developers decided to effect a change in the default, to enable the setting for termination of child processes upon log out of a session.

You can revert this setting in your logind.conf (/etc/systemd/logind.conf):


You can also run tmux with a systemd-run wrapper like the following:

systemd-run --scope --user tmux

For these systems, you may just want to alias the tmux (or screen) command:

alias tmux="systemd-run --scope --user tmux"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.