LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-25-2021, 07:42 AM   #1
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
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?
 
Old 11-02-2021, 09:54 AM   #2
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
do you mean to close?

if you hit ctrl + B then hit Shift + ?
this pops up the help, your looking for "break pane" maybe?
mine is set to Shift + !

Last edited by methinx; 11-02-2021 at 09:55 AM. Reason: forgot to add the "how to" buttons
 
Old 11-02-2021, 11:50 PM   #3
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
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.
 
Old 11-04-2021, 09:28 AM   #4
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
man tmux

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')

Last edited by methinx; 11-04-2021 at 09:33 AM.
 
Old 11-04-2021, 09:35 AM   #5
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
Right. I have those covered in #3 above. Even when .tmux.conf is empty, it still kills the whole session when any window or pane gets closed.
 
Old 11-04-2021, 09:40 AM   #6
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
FILES
~/.tmux.conf Default tmux configuration file.
/etc/tmux.conf System-wide configuration file.

I appologize
 
Old 11-04-2021, 09:42 AM   #7
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
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.
 
Old 11-04-2021, 09:43 AM   #8
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
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
 
Old 11-04-2021, 09:45 AM   #9
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
I don't have the latest either:

Code:
$ tmux -V
tmux 2.8
 
Old 11-04-2021, 09:53 AM   #10
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
what was your findings when searching for FILES in man tmux?
 
Old 11-04-2021, 09:59 AM   #11
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
For what it is worth, here is the quote from the manual page on that system:

Code:
$ man tmux | grep -A 2 '^FILES'
FILES
     ~/.tmux.conf       Default tmux configuration file.
     /etc/tmux.conf     System-wide configuration file.
Again, ~/.tmux.conf seems to have no effect in this and there has never been an instance of /etc/tmux.conf there.
 
Old 11-04-2021, 10:14 AM   #12
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
can you verify the file is "not" there by (ls /etc/tmux.conf)

also there is an option -f to start tmux with a specified file. maybe an alias got set?
maybe a bashrc entry?
 
Old 11-04-2021, 10:23 AM   #13
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
There is no global configuration file, as mentioned already.

If I run,

Code:
tmux -f /dev/null
then I still get the same problem.
 
Old 11-04-2021, 11:13 AM   #14
methinx
LQ Newbie
 
Registered: Dec 2011
Location: Michigan
Distribution: slackware 15
Posts: 20

Rep: Reputation: Disabled
ok since its not there, create one.. science time! see if it overrides whatever you did that you do not know.
 
Old 11-04-2021, 11:15 AM   #15
Turbocapitalist
LQ Guru
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 7,386

Original Poster
Blog Entries: 3

Rep: Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776Reputation: 3776
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.
 
  


Reply

Tags
destroy-unattached, tmux



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to launch "cinnamon-session-cinnamon" X session "cinnamon-session-cinnamon" -found; Falling back to default "session." xxxindigo Linux Mint 22 09-01-2019 09:21 AM
[SOLVED] Creating a tmux session inside another session sleftar Linux - Newbie 1 11-10-2015 06:54 PM
tmux traverse pane command sleftar Linux - Newbie 1 10-31-2015 01:22 PM
Vim scrolling down when opening new pane in tmux akseli0x61 Linux - Software 3 04-19-2015 08:18 PM
!! Problem !! Minimizing ANY window EXITS the Program / Browser window NOoBuntuLinux Linux - Newbie 6 11-20-2008 02:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration