Spark
Spark

Reputation: 308

tmux windows closing due to auto-logout

I'm running into an issue with auto-logout when using tmux.

When I open a new window in tmux, $TMOUT is set to 600. This causes the shell to auto-logout on me after a while. I can't overwrite it or unset it because it is read only. If I start a new bash process in that window, $TMOUT is set to 0 and does not time out on me (the desired behavior).

My question is, why does a new tmux window have different environment settings than a new bash process? How can I change the TMOUT setting for new tmux windows?

Upvotes: 5

Views: 3340

Answers (1)

user11274868
user11274868

Reputation:

Here are two possibilities you could check:

  • You started tmux from a shell with TMOUT exported, so it is in the global environment applied to new panes. Check tmux showenv -g and if present remove with tmux setenv -ug TMOUT. It should not be necessary to export TMOUT in the shell which would avoid this.

  • tmux starts login shells by default and one of your shell profiles that is only run by login shells is setting TMOUT. Check if you also see if with bash -l. If this is the case you can either track down where it is being set or change tmux not to start login shells by changing default-command.

Upvotes: 8

Related Questions