the PATH variable I defined in ~/.bashrc
There's your problem right there. .bashrc
is an initialization file for interactive shells. Gmrun doesn't start an interactive shell, it starts the program you tell it to start. So your PATH is never getting set. In fact, in order to get completion in gmrun, you need the PATH environment variable to be set in the environment that you run gmrun in.
Set PATH in the right place: ~/.profile
. This file is read when your session starts. That's where you should define your environment variables.
Don't read .profile
from .bashrc
or vice versa. They have completely different purposes and are used in different purposes.
Due to a quirk of bash, .bashrc
isn't read in an interactive login shell, so you should write a .bash_profile
that loads the other two for this case:
. ~/.profile
case $- in *i*) . ~/.bashrc;; esac
See Is there a ".bashrc" equivalent file read by all shells? and the other posts I cite there for more details.
.bashrc
make sense only for interactive shells (so there is no environment variable definition in my .bashrc, in my experience those who set environment variables definition in their .bashrc are better served by setting the option which make launch shells from their terminal emulator as login shells). – AProgrammer Jul 30 '13 at 14:37PS1
doesn't tell you anything about whether the shell is interactive. I know this is all over the web, I have no idea where it comes from, it's plain wrong. There's a reliable, portable way to determine whether a shell is interactive: test whether$-
containsi
. – Gilles 'SO- stop being evil' Jul 31 '13 at 01:02