JanDeDobbeleer / oh-my-posh

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

Conda virtualenv name is not part of the theme's formatting #500

Closed V4G4X closed 3 years ago

V4G4X commented 3 years ago

Prerequisites

Description

Tried looking for similar issues, but didn't find anything going over this exact issue.
Conda's environment name is not being formatted.
$env:CONDA_DEFAULT_ENV prints base.
$env:CONDA_ENV_NAME and $env:CONDA_ENV_PATH both are unset/empty.

Tried adding the following to oh-my-posh\current\themes\powerlevel10k_classic.omp.json:

{
  "type": "python",
  "style": "powerline",
  "powerline_symbol": "\uE0B0",
  "foreground": "#100e23",
  "background": "#906cff",
  "properties": {
    "display_virtual_env": true,
    "display_default": true,
    "prefix": " \uE235 "
  }
},

But it didn't make any difference as display_virtual_env and display_default both default to true anyway,

Environment

Steps to Reproduce

  1. Run conda Powershell Prompt on Window Terminal.
    Windows Terminal's settings.json uses this to run conda over Powershell
    "commandline": "powershell.exe -ExecutionPolicy ByPass -NoExit -Command & 'C:\\Users\\varun\\miniconda3\\shell\\condabin\\conda-hook.ps1' ; conda activate 'C:\\Users\\varun\\miniconda3'"
  2. Notice how the default conda virtualenv name is not formatted.

Expected behavior: Conda's virtualenv name should be formatted as part of the theme.

Actual behavior: Conda's virtualenv name is simply added to the left of the oh-my-posh theme formatting.

Screenshots

powerlevel10k_classic image

jandedobbeleer:
image

JanDeDobbeleer commented 3 years ago

@V4G4X that's unrelated to oh-my-posh and related to the content of conda-hook.ps1 that hijacks the prompt function (like we do). If you examine that file you should be able to find a switch that doesn't do that on activation (differs a bit per Python tool).

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.