16

TMUX defaults to launching shells as login shells. I am looking for a way to negate this behavior (so that it will launch non-login shells) in .tmux.conf file.

Currently I can use tmux set-option -g default-command "/bin/bash" from outside of tmux. But this can only be done when the tmux has already been launched and I can't seem to find a way to integrate it into the conf file.

1 Answer 1

19

You need to modify your .tmux.conf like this:

To disable this behaviour, add to ~/.tmux.conf:

set -g default-command "${SHELL}"

From: https://wiki.archlinux.org/index.php/tmux#Start_a_non-login_shell

1
  • For bash (and possibly other shells), you may want to add the -i option to make the new shell an interactive one. That will cause it to source ~/.bashrc, which can be important for defining your shell prompt (PS1 variable) and aliases.
    – Doug Paul
    Jul 3, 2023 at 17:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .