allvirtualenv not compatible with powerline

9 views
Skip to first unread message

Laurent De Buyst

unread,
Jan 23, 2019, 11:41:26 AM1/23/19
to virtualenvwrapper
Hello,

Every time I issue an 'allvirtualenv' command or one that relies on it (I initially noticed this when using 'lsvirtualenv'), my powerline prompt freaks out.

After searching around a bit, I uncovered that this is caused by the fact that 'allvirtualenv' changes the IFS shell variable on line 1313 of virtualenvwrapper.sh and then proceeds to just unset it on line 1326, leaving it pretty much blank.

As evidenced by this bug report for a totally different project, the powerline shell prompt really needs IFS to contain a space: https://github.com/ohmybash/oh-my-bash/issues/36


Please adapt 'allvirtualenv' so that it saves the state of IFS before changing it, and then returns it to this saved state afterwards. Changing shell variables like this is not very neighbourly.

Thanks in advance.

Laurent De Buyst

unread,
Jan 24, 2019, 3:03:37 AM1/24/19
to virtualenvwrapper
After digging a little bit deeper this morning:

It seems that the 'unset IFS' command on line 1326 is indeed supposed to return the IFS to its default state. So something else must be happening.

And then I found this little comment on StackExchange:

"Beware that in bash, unset IFS fails to unset IFS if it had been declared local in a parent context (function context) and not in the current context. – Stéphane Chazelas Jul 31 '18 at 14:03"

So it turns out that no, in this case where we do have a function context, 'unset IFS' will not do what is needed.

Jason Myers

unread,
Jan 24, 2019, 6:02:18 AM1/24/19
to virtuale...@googlegroups.com
I’ll give this a look this evening and store it amup front and reset when done.

--
You received this message because you are subscribed to the Google Groups "virtualenvwrapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to virtualenvwrap...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages