4

My tmux started to behave in a strange way, briefly. Today I noticed that my tmux session does not start with a bash shell but instead it starts with ?(no idea). What I can see is just a dollar $. Then if I try to call bash with bash it returns

sessions should be nested with care, unset $TMUX to force.

tmux without bash

I wanted to add a default-shell for tmux in the ~/.tmux.conf file, but it doesn't exist and if I create it tmux seems not seeing it.

chicks
  • 556
  • 4
  • 14
Peter
  • 141
  • 1
  • 2
  • 4

1 Answers1

4

Manual page of tmux state the default-shell option process:

default-shell path Specify the default shell. This is used as the login shell for new windows when the default-command option is set to empty, and must be the full path of the executable. When started tmux tries to set a default value from the first suitable of the SHELL environment variable, the shell returned by getpwuid(3), or /bin/sh This option should be configured when tmux is used as a login shell.

To set the default shell of tmux to Bash in .tmux.conf file, you must write it as: set-option -g default-shell "/bin/bash"

If you want to set your system default shell (not specifically bash) as default-shell, you can do set-option -g default-shell $SHELL in your .tmux.conf file. This requires that the $SHELL variable is correctly set, though. See https://superuser.com/a/395161/325399

Aulis Ronkainen
  • 2,612
  • 42
  • 29
  • 27