oh-my-fish / plugin-foreign-env

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

Fix spurious SHLVL variable assignment by fenv (alternate method) #20

Closed edlanglois closed 5 years ago

edlanglois commented 5 years ago

This is an alternative to #19 that solves the same issue in a different way.

Skips assigning the SHLVL variable if it is the assignment list.

The 2nd env call is made within one additional bash subshell causing the SHLVL variable to differ and therefore be included in the diff.

In fish 3.0 this assignment resulted in a warning message because SHLVL is read only.

edlanglois commented 5 years ago

I agree, I implemented this first before finding the underlying issue and decided to make it available just in case.