tmux and Mac Aliases

The alias command is a great operating system feature to improve productivity on the command line. However, I had an issue with tmux not loading my aliases when I started a new session.

I added my aliases to my ~./bash_profile, and they would work just fine when I opened a new terminal window. However, tmux seemed to just ignore them.

It turns out that tmux ignores the .bash_profile file, and, instead, reads from .bashrc. At least, on a Mac it does. I didn’t have a .bashrc file. So, I created one in my home directory and included a single line in it:

source ~/.bash_profile

The next time that I started a tmux session, I was able to use my aliases successfully.

Leave a Reply

Your email address will not be published. Required fields are marked *