LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   bash aliases lost within tmux (https://www.linuxquestions.org/questions/linux-general-1/bash-aliases-lost-within-tmux-890665/)

sycamorex 07-08-2011 04:47 PM

bash aliases lost within tmux
 
I just noticed that my .bashrc aliases (eg. alias www='cd ~/data/public_html') don't work from within tmux. They work fine from screen, though.

I don't think I've got anything special in ~/tmux.conf
Code:

# C-a just like in screen
unbind C-b
set -g prefix C-a

set -g default-terminal "screen-256color"

my .bashrc
Code:


. /etc/profile

#if [ -f /etc/bashrc ]; then
#        . /etc/bashrc
#fi

# CFLAGS
CHOST="x86_64"
export CFLAGS="-march=native -O2 -pipe -fPIC"
export CXXFLAGS="${CFLAGS}"
export PATH=$PATH:~/bin
export MAKEFLAGS="-j3"
export QUEUEDIR=~/data/queues
alias films='cd ~/data/films'
alias www='cd ~/data/public_html'

Thanks

sycamorex 07-08-2011 07:51 PM

OK, tmux starts a login shell, and a login shell does not source ~/.bashrc

I added the following to ~/.bash_profile

Code:

case $- in *i*) . ~/.bashrc;; esac
which solved the problem.

bigrigdriver 07-08-2011 07:52 PM

I believe you will find the solution here: http://unix.stackexchange.com/questi...-a-bash-script

sycamorex 07-08-2011 07:53 PM

Quote:

Originally Posted by bigrigdriver (Post 4409359)
I believe you will find the solution here: http://unix.stackexchange.com/questi...-a-bash-script

We must have been looking at this page at the same time:)


All times are GMT -5. The time now is 05:28 AM.