tmux always exits whole session when any pane or window closes
Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
tmux always exits whole session when any pane or window closes
No matter what, tmux exits an active session completely any time I kill a window or even an individual pane. I want the session to stick around while there are other windows still active until I finally close the last window. In other words, I'd like it to go back to its default behavior in that regard.
Currently, the configuration file .tmux.conf shows this, and only this:
Code:
set-option -g destroy-unattached off
set-option -g remain-on-exit on
I had tmux set up to exit when a window or pane closed with something like this:
Code:
set-option -g destroy-unattached on
Or else, I had a hook set. Either way, it has been removed and neither is in .tmux.conf and the system has since been rebooted. Yet the destroy-unattached behavior persists.
Both of these show nothing:
Code:
tmux show-hooks -g
tmux show-hooks
What have I missed? Is there some other file besides .tmux.conf which needs to be edited?
Thanks, that's part of the way there. With break-pane I can close an individual pane. However, tmux still kills the whole session when I close any individual window, even while there are other windows open, regardless of whether those other windows have one pane or many.
Again,
Code:
$ cat ~/.tmux.conf
set-option -g destroy-unattached off
set-option -g detach-on-destroy off
set-option -g remain-on-exit on
Last edited by Turbocapitalist; 11-02-2021 at 11:51 PM.
kill-session [-a] [-t target-session]
Destroy the given session, closing any windows linked to it and
no other sessions, and detaching all clients attached to it. If
-a is given, all sessions but the specified one is killed.
I got this from man tmux then I did a /search for the word kill. maybe that can help you?
that code that you posted,
destroy-unattached [on | off]
If enabled and the session is no longer attached to any
clients, it is destroyed.
detach-on-destroy [on | off]
If on (the default), the client is detached when the ses-
sion it is attached to is destroyed. If off, the client
is switched to the most recently active of the remaining
sessions.
set-remain-on-exit [on | off]
Set the remain-on-exit window option for any windows
first created in this session. When this option is true,
windows in which the running program has exited do not
close, instead remaining open but inactivate. Use the
respawn-window command to reactivate such a window, or
the kill-window command to destroy it.
Global
session or window options are listed if -g is used.
im not sure what the -g does in your code. i hope this helps
set-option [-agoqsuw] [-t target-session | target-window] option value
(alias: set)
Set a window option with -w (equivalent to the set-window-option
command), a server option with -s, otherwise a session option.
If -g is given, the global session or window option is set. The
-u flag unsets an option, so a session inherits the option from
the global options (or with -g, restores a global option to the
default).
so the -g restores a global option to the default in this text^^ (man tmux '/set-option')
No problem. That system has no /etc/tmux.conf but I have been adding, removing, and changing .tmux.conf in the account to see how / if I can get around this problem. Like I mentioned, the system has even been rebooted since clearing .tmux.conf the first time.
I am using tmux 2.1, I may have different files then you. Which version are you on ? tmux -V
try searching "your" man tmux for /FILES just in case you have different locations
No root access available on that system. The problem was created without root access, so it follows that the solution must also be without root access.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.