有没有一种方法可以在终端中自定义当前python虚拟环境的名称外观?

时间:2020-08-25 07:58:58

标签: python

This is how the name looks now.

我想做的是更改颜色,删除空格,使用方括号而不是圆形的括号。

1 个答案:

答案 0 :(得分:0)

您的问题类似于How to customize virtualenv shell prompt,但增加了两个成分:

  1. 您要应用着色。
  2. 您未指定操作系统/外壳;也许您对任何OS / shell感兴趣,或者至少对两个最常见的Win10和bash感兴趣。

所以在这里您可以找到完整的信息。

重击:https://unix.stackexchange.com/questions/124407/what-color-codes-can-i-use-in-my-ps1-prompt

Win10: https://superuser.com/questions/427820/how-to-change-only-the-prompt-color-of-the-windows-command-line。 另请参见How to echo with different colors in the Windows command line