JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
17.02k stars 2.37k forks source link

Prompt isn't showing python virtual environment. #706

Closed adityamwagh closed 3 years ago

adityamwagh commented 3 years ago

Prerequisites

Description

The space theme isn't showing virtual environments in the prompt.

Environment

Steps to Reproduce

  1. Set the theme to any theme
  2. Create a virtual environment using virtualenv .env
  3. Activate using source .env/bin/activate

Expected behavior: Show which virtual environment I am in.

Actual behavior: No difference in prompt.

JanDeDobbeleer commented 3 years ago

@adityamwagh does your theme/config have a Python segment? If so, can you share the configuration?

adityamwagh commented 3 years ago

This is the content of the python segment. According to the documentation, display_virtual_env defaults to true. So not mentioning it shouldn't be an issue.

{
  "type": "python",
  "style": "powerline",
  "foreground": "#906cff",
  "properties": {
    "prefix": "\u005b\uE235 ",
    "postfix": "\u005D "
  }
},
JanDeDobbeleer commented 3 years ago

@adityamwagh we look at a few environment variables to define if there's a virtual env active. Can you confirm one of these actually holds a value:

Also, there need to be python files in the folder to actually show the context in this basic use-case. Otherwise you need to add "display_mode": "context" to the segment's properties.

adityamwagh commented 3 years ago

Also, there need to be python files in the folder to actually show the context in this basic use-case. Otherwise you need to add "display_mode": "context" to the segment's properties.

Found the culprit. Thanks!

github-actions[bot] commented 5 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.