oh-my-fish / plugin-foreign-env

Run foreign bash scripts and capture exported environment variables
MIT License
221 stars 15 forks source link

PATH is modified in all my shell #9

Closed mrvkino closed 8 years ago

mrvkino commented 8 years ago

When I use the fenv on my bash configuration script, the fenv.apply does a set -g -x on all the variable. But this causes the creation of a new environment variable name ORIGINAL_PATH in fish when setting the PATH variable.

This variable causes me some problem when I try to parse the environment variable in python. Here are the two environment variables.

ORIGINAL_PATH=/usr/local/bin/usr/bin/bin/usr/sbin/sbin/opt/X11/bin
PATH=/Users/Shadow/perl5/perlbrew/bin:/Users/Shadow/perl5/perlbrew/perls/perl-5.18.4/bin:/usr/local/Cellar/pyenv-virtualenv/20160202/shims:/Users/Shadow/.pyenv/shims:/Users/Shadow/.rbenv/shims:/opt/X11/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:.:/Users/Shadow/bin:/usr/X11R6/bin:/usr/X11/bin:/Users/Shadow/go_workdir/bin:.

The PATH has ':' separator and not the ORIGINAL_PATH. This causes problem when trying to read the variable, since it is seen as a string with new line instead of a variable with a list of path.

It seem to be caused by the option "-g -x" when setting PATH. As mentioned in the doc on PATH, simply doing a set on PATH will work. And it does not create the ORIGINAL_PATH variable. It could be done with the 'if' that is already present for the PATH variable in fenv.apply..

derekstavis commented 8 years ago

Hi @mrvkino. Thank you for your report. ORIGINAL_PATH is a Oh My Fish feature which was removed. Could you please try to omf update and check again if ORIGINAL_PATH variable persist?

mrvkino commented 8 years ago

Great! The update fixed it!

derekstavis commented 8 years ago

Awesome! Closing the issue!