LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 07-08-2011, 05:47 PM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
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
 
Old 07-08-2011, 08:51 PM   #2
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Original Poster
Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
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.
 
Old 07-08-2011, 08:52 PM   #3
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian Squeeze
Posts: 5,805

Rep: Reputation: 324Reputation: 324Reputation: 324Reputation: 324
I believe you will find the solution here: http://unix.stackexchange.com/questi...-a-bash-script
 
Old 07-08-2011, 08:53 PM   #4
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,614
Blog Entries: 1

Original Poster
Rep: Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052Reputation: 1052
Quote:
Originally Posted by bigrigdriver View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
aliases Lost When Using screen MQMan Slackware 10 04-18-2011 06:25 PM
[SOLVED] Bash Aliases Not Working schachwizard Linux - Newbie 6 10-12-2010 05:21 PM
Aliases got lost surya_prakash Linux - Software 8 05-10-2009 10:34 PM
aliases with bash shell edccmu22 Linux - Newbie 3 11-04-2007 12:59 PM
Bash aliases in OS X?? Grife Other *NIX 3 03-14-2007 07:26 AM


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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration