Hey there, command line enthusiasts! Ever found yourself in the middle of a Tmux session wishing you could use your favorite shell, Bash, by default? I know I have, and I bet I’m not alone. The good news is, you can indeed set Bash as your default shell in Tmux, and I’m here to show you exactly how to do it. It’s a handy trick that can make your Tmux sessions feel much more like home. So, without further ado, let’s dive into the world of shells and Tmux!
New to Tmux? No problem, the Tmux fundamentals have got you covered. If you’re already on board, let’s set sail!
First-timers, take a quick detour through the basics of Tmux. Everyone else, strap in and let’s get started!
Setting bash as default shell for tmux
Setting default shell is easy and can be done using the default-shell
command. It’s better to set it in the global ~/.tmux.conf
.
set -g default-shell /bin/sh
You have to reload changes in tmux config tmux.conf
so that it reflects-
tmux source-file ~/.tmux.conf
You will have to kill your existing tmux sessions to make sure it reflects.
killall tmux
If the above doesn’t help, use htop
to find all processes named tmux
and kill them all using the following command-
kill -9 <processid>
or if you need sudo
privileges to kill,
sudo kill -9 <processid>
You can also set the default shell to zsh, also check steps to set default shell to fish.
I hope you found this article useful, glad that you found it easy to set default shell to bash in Tmux. Well, folks, that’s all there is to it! You’ve just learned how to set Bash as your default shell in Tmux. It’s a simple yet impactful change that can make your Tmux experience all the more enjoyable. So go ahead, personalize your Tmux sessions, and make Bash your companion inside the Tmux world. Stay tuned for more command line tips and tricks. Happy shell scripting!
You can also check out the complete tmux cheatsheet of keyboard shortcuts and mouse shortcuts.