Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have following ~/.bash_profile

[[ -f ~/.bashrc ]] && . ~/.bashrc

and ~/.bashrc

### Check for shell interactivity.

if [[ $- != *i* ]] ; then
    return
fi

### Nyan-cat prompt.

PS1="\`if [ \$? = 0 ]; then echo \[\e[35m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\` \$ "

### PATH

export PATH=$PATH:$HOME/bin

So when I run emacs from terminal all OK. When I start it with dmenu (getenv "PATH") and exec-path variable doesn't contain ~/bin directory.

When I do it in xfce with xfrun4 command with same bash configuration all seams to work too.

What is the problem with dmenu?

share|improve this question
    
This question needs a bit of work ... very confusing. Anyway, I would take a look at the dmenu documentation since you can run emacs fine in other ways. Perhaps dmenu doesn't run the bash config files by default? –  Peter Jenkins Nov 15 '12 at 17:31
    
Or perhaps it loads configuration once (at startup fo sorts) and you updated your profile afterwards? –  gt6989b Nov 15 '12 at 17:42
    
No, my configuration doesn't change after I run dwm session. –  proofit404 Nov 15 '12 at 17:45

2 Answers 2

TERM=dumb in emacs shell so it never gets past the interactive test at the top of your .bashrc .bash_profile is not run in emacs either.

Try moving the stuff you think is safe to run in non-interactive mode (think environment variables that won't affect rsync, git, remote ssh command, cron jobs, etc.) to above the test for interactive mode where it returns at the top of the script.

share|improve this answer
1  
M-x shell run fine. But if I call compile or comint commands, then environment doesn't work with ~/bin directory. –  proofit404 Nov 15 '12 at 18:12
up vote 0 down vote accepted

I fix my problem with editing my ~/.xsession file. Add following to it before running dwm.

export PATH=$PATH:$HOME/bin

Now you can remove same lines from you .bashrc file.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.