Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have following ~/.bash_profile

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

and ~/.bashrc

### Check for shell interactivity.

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

### 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
up vote 1 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

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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .