Exit TMUX with the 'close window' button

So I know a lot of people like the persistence feature of tmux but personally I hate it. I was wondering if there was any way to change the terminal so that clicking the ‘close window’ button in the taskbar would exit the session when closing the window, just like closing a normal terminal. This way I wouldn’t end up having to manually kill sessions, and forget, and end up with 10 running sessions. Couldn’t find anything online so I thought I’d ask here.

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

Type your comment> @PapyrusTheGuru said:

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

You can just type “exit”

Type your comment> @LMAY75 said:

Type your comment> @PapyrusTheGuru said:

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

You can just type “exit”

Technically you’re right but also wrong, you see, when you type “exit” you just detach it, you don’t actually kill that session (to my knowledge) you can easily test this by starting a new tmux session, typing exit and then tmux ls

@PapyrusTheGuru said:
Type your comment> @LMAY75 said:

Type your comment> @PapyrusTheGuru said:

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

You can just type “exit”

Technically you’re right but also wrong, you see, when you type “exit” you just detach it, you don’t actually kill that session (to my knowledge) you can easily test this by starting a new tmux session, typing exit and then tmux ls

no it kills the session

Type your comment> @LMAY75 said:

@PapyrusTheGuru said:
Type your comment> @LMAY75 said:

Type your comment> @PapyrusTheGuru said:

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

You can just type “exit”

Technically you’re right but also wrong, you see, when you type “exit” you just detach it, you don’t actually kill that session (to my knowledge) you can easily test this by starting a new tmux session, typing exit and then tmux ls

no it kills the session

Ah, sorry about that. I don’t have that much experience with tmux :confused: hopefully you’ll figure it out.

Type your comment> @PapyrusTheGuru said:

Type your comment> @LMAY75 said:

@PapyrusTheGuru said:
Type your comment> @LMAY75 said:

Type your comment> @PapyrusTheGuru said:

I close my Tmux sessions by doing: CTRL + B (Or A, depending on what your prefix is.) + : then type kill-session.

I haven’t really found an alternative to this, but if you do please tell me.

You can just type “exit”

Technically you’re right but also wrong, you see, when you type “exit” you just detach it, you don’t actually kill that session (to my knowledge) you can easily test this by starting a new tmux session, typing exit and then tmux ls

no it kills the session

Ah, sorry about that. I don’t have that much experience with tmux :confused: hopefully you’ll figure it out.

Don’t worry ab it lol at least you learned something new and I have a feeling you will be much happier typing “exit” over “tmux kill-session -t 1” :smile: