atweiden / fzf-extras

Key bindings from fzf wiki
MIT License
192 stars 23 forks source link

Mutating IFS environment variable globally causes breakage #9

Closed linduxed closed 7 years ago

linduxed commented 7 years ago

Mutating the IFS environment variable without restoring it to its original state can break other shell scripts relying on IFS being unmodified.

In the fe function, prior to 63260197bf9419bf980e65dbff8d096c4c992046 the IFS environment variable was set and then unset. The behaviour of Zsh (and probably Bash, although I don't know for sure) with an unset IFS is to use the default value of IFS. This probably also means that before 63260197bf9419bf980e65dbff8d096c4c992046, if one had a custom IFS that differed from the default one, it got clobbered and the default one was used instead (due to the unset).

The intent seems to be that IFS should temporarily be set to a different value, which is not the case right now.

Relatedly, the fo function exhibits the same problematic behaviour.

atweiden commented 7 years ago

I'm reading here that local IFS within a function as per https://github.com/atweiden/fzf-extras/commit/513852486861aed038b492656645ac940fbca616 is a possible solution. Can you pull the fix-ifs branch and see if that fixes #9?

linduxed commented 7 years ago

That does seem to fix the problem, yes. I've only tried for Zsh, however.

atweiden commented 7 years ago

fixed