shell: bash, fish

terminal: xfce4-terminal

other-applications: xfce4-whiskermenu, tmux

I'm trying to have GVim inherit the full path from bash and/or fish when launching from from xfce-whisker-menu.

From whisker-menu, I have the default paths set inside gvim: /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

When launched from the terminal, of course I get the full path of the shell.

I tried altering my gvim.desktop to

Exec=/bin/bash -c 'gvim -f %F'

But that just ends up launching xfce4-terminal and gvim without the full inherited path.

In addition, following this answer, I changed my ~/.profile to inherit from fish shell

# Paths
if [ -x "/usr/bin/fish" ]; then
  PATH="$(/usr/bin/fish -c 'echo $PATH')" 
  # set PATH so it includes user's private bin if it exists
  if [ -d "$HOME/bin" ] ; then

I tested this script out in bash and apparently $PATH isn't persistent after the script ends. My shell in ~/.vimrc is set to bash

  • I do not see any actual export in your ~/.profile – grochmal Aug 22 '16 at 3:31
  • PATH="$(/usr/bin/fish -c 'echo $PATH')" won't work as in fish, $PATH is a list, so it will print the elements separated with spaces, not colons. You'll want string join ":" -- $PATH instead of the echo. – faho Aug 22 '16 at 9:03
  • Ok, @grochmal and @faho, I changed my ~/.profile to PATH="$(/usr/bin/fish -c 'string join ':' -- $PATH')" and export $PATH – Sourlemon11 Aug 22 '16 at 19:37
  • The ~/.profile successfully sets the path for bash but GVim still will not inherit the path from bash. In my ~/.local/share/applications/gvim.desktop, I have Exec=/bin/bash -c "bash ~/.profile; echo $PATH; gvim -f %F" and Terminal=true. So the path is set for the terminal that is launched with gvim but not gvim itself. – Sourlemon11 Aug 22 '16 at 19:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.