pypa/virtualenv — pull request #353 by ryanartecona (2012-11-06 17:43:21+00:00)
Title: Cleaner fish prompt-switching behavior

Fixed an issue that flattened a multi-line custom prompt into a single line, and cleaned up the prompt prefixing behavior.

The `fish_prompt` function is now copied via `functions -c` instead of by replacing the function name of the `functions` string output. (see here: http://ridiculousfish.com/shell/user_doc/html/commands.html#functions)

Also, `_old_fish_prompt` is called directly after the `(virtualenv)` prefix is printed, instead of being shoved into a `%s` with a `printf`. This does not change the behavior for the default prompt, but preserves the newlines of any user-defined custom prompt (e.g. mine). This also avoids some other weird behavior caused by the `printf`.