Using tmux loses all my bash aliases, how can I make them stay?

My .bashrc does

if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi 

which includes running my .bash_aliases and giving me a ton of the aliases that I defined.

However, if I try to use TMUX (called with tmux ), the only alias that I currently have is:

$ alias return # will show ....

 $ alias rvm-restart='rvm_reload_flag=1 source '\''/home/durrantm/.rvm/scripts/rvm'\''' 

How can I use tmux and all my available aliases.

I'm on Ubuntu 12.04

The end of my .bashrc file is as follows:

 if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # Automatic cd'ing shopt -s autocd if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM export EDITOR=vim git config --global --add color.ui true 
+8
bash alias rvm tmux
source share
1 answer

tmux calls your shell as an input shell. Login plugins do not process .bashrc , but use .bash_profile .

You can simply do .bash_profile read your .bashrc :

 echo 'source ~/.bashrc' >> ~/.bash_profile 
+14
source share

All Articles