Package: powerline-venvprompt
powerline-venvpromptpowerline-venvpromptis aPowerlinestatus segment that displays the prompt set by thevenv --promptoption.For example, if a virtual environment was created with the commandpython3 -m venv venv --prompt "my_prompt", the prompt will be "my_prompt" instead of "venv" or the name of the folder containingvenv.InstallationMake sure Powerline is installed and functioning and that you have a custom configuration (most likely in~/.config/powerline).Install the package.python3-mpipinstall--userpowerline-venvpromptAdd to your theme.Typically, theconfig.jsonfile that controls your Powerline setup is in~/.config/powerline. The theme itself will be in~/.config/powerline/themes/shell. Add the following lines to your theme JSON file (note the segment specification uses an underscore, not a hyphen):{"function":"powerline_venvprompt.segments.prompt","priority":10},Set the priority however you like.powerline-venvprompttakes the place of thepowerline.segments.common.env.virtualenvsegment, so if that one is already in your config file you should remove it. If there is no prompt set in the venv, it will display the same thing thatpowerline.segments.common.env.virtualenvwould have shown.OptionsThe options forpowerline-venvpromptare inherited from the defaultpowerline.segments.common.env.virtualenvsegmentin version 2.8.3.ignore_venvIf true, the venv virtual environment will be ignored (including the --prompt option). Default value is false.ignore_condaIf true, the conda virtual environment will be ignored. Default value is false.ignored_namesA list of names that will be ignored. If a virtual environment has one of these names (and no explicit prompt defined), the prompt will be the name of the folder containing venv.Here is an example configuration with the default values:{"function":"powerline_venvprompt.segments.prompt","priority":10,"args":{"ignore_venv":false,"ignore_conda":false,"ignored_names":["venv",".venv"]}},TroubleshootingIf you activate a virtual environment and the prompt isn't displayed, here are some potential solutions.Restart PowerlineUse the commandpowerline-daemon -rto restart Powerline after any change to your configuration.Check for errorsUse the commandpowerline-lintto display configuration errors.You may see a number of unrelated issues (my installation has over a dozen errors in the stockcolorschemes/vim/__main__.jsonfile). Ignore those.You will see the following message. You can ignore this.powerline-venvpromptuses the samevirtualenvcolor scheme that the defaultpowerline.segments.common.env.virtualenvuses.found highlight group prompt not defined in the following colorschemes: default, solarized
(If not specified otherwise in documentation, highlight group for function segments
is the same as the function name.)
  in "~/.config/powerline/themes/shell/steve.json", line 17, column 49:
     ...  "powerline_venvprompt.segments.prompt",If you see the message "failed to import module powerline_venvprompt.segments" that might mean Powerline is not searching the folder containing yourpowerline_venvpromptfolder. If this is the case, add the folder to yourconfig.jsonfile. Use the commandpython3 -m pip show powerline-venvprompt | grep Locationto determine the required path.$pipshowpowerline-venvprompt|grepLocation
Location:/Users/steve/Library/Python/3.11/lib/python/site-packagesAdd this to yourconfig.jsonfile:"paths":["/Users/steve/Library/Python/3.11/lib/python/site-packages"],If all else fails, use GitHub Issues to report your problem and I'll do my best to help.