130: virtualenv activation prompt consistency across shells - an open source dev and test adventure - Brian Skinn
Test & Code09/13/20 • 36 min
virtualenv supports six shells: bash, csh, fish, xonsh, cmd, posh. Each handles prompts slightly differently. Although the virtualenv custom prompt behavior should be the same across shells, Brian Skinn noticed inconsistencies. He set out to fix those inconsistencies. That was the start of an adventure in open source collaboration, shell prompt internals, difficult test problems, and continuous integration quirks.
Brian Skinn initially noticed that on Windows cmd, a space was added between a prefix defined by --prompt and the rest of the prompt, whereas on bash no space was added.
For reference, there were/are three nominal virtualenv prompt modification behaviors, all of which apply to the prompt changes that are made at the time of virtualenv activation:
- If the environment variable VIRTUAL_ENV_DISABLE_PROMPT is defined and non-empty at activation time, do not modify the prompt at all. Otherwise:
- If the --prompt argument was supplied at creation time, use that argument as the prefix to apply to the prompt; or,
- If the --prompt argument was not supplied at creation time, use the default prefix of "() " as the prefix (the environment folder name surrounded by parentheses, and with a trailing space after the last paren.
Special Guest: Brian Skinn.
Sponsored By:
- Talk Python Training: Online video courses for Python developers
- HoneyBadger: When bad things happen, it's nice to know that Honeybadger has your back. 30% off for first 6 months when you mention Test & Code Podcast when signing up.
- PyCharm Professional: Try PyCharm Pro for 4 months and learn how PyCharm will save you time. Promo Code: TESTANDCODE22
Links:
09/13/20 • 36 min
Generate a badge
Get a badge for your website that links back to this episode
<a href="https://goodpods.com/podcasts/test-and-code-41514/130-virtualenv-activation-prompt-consistency-across-shells-an-open-sou-8075595"> <img src="https://storage.googleapis.com/goodpods-images-bucket/badges/generic-badge-1.svg" alt="listen to 130: virtualenv activation prompt consistency across shells - an open source dev and test adventure - brian skinn on goodpods" style="width: 225px" /> </a>
Copy