edc / bass

Make Bash utilities usable in Fish shell
MIT License
2.22k stars 71 forks source link

Bass does not track unset variables #47

Closed daveyarwood closed 7 years ago

daveyarwood commented 7 years ago

I'm building some tooling around bass, and I noticed that when sourcing a bash script that unsets environment variables (e.g. for clearing sensitive information once it's no longer needed), bass does not remove the variable from the fish environment.

I'm happy to contribute a PR if needed -- I took a quick look at __bass.py, and it looks like we're taking a JSON dump of the environment before and after running the script, so it ought to just be a matter of iterating through each var in old_env that does not exist in new_env and adding set -e $var_name to the script to be sourced in the fish environment.

daveyarwood commented 7 years ago

48 fixes this for me when I make the change to __bass.py locally.