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

oh-my-posh wont start in powershell #2959

Closed kubilayerislik closed 1 year ago

kubilayerislik commented 1 year ago

Code of Conduct

What happened?

I am using oh-my-posh v:12.3.3 in windows powershell wih anaconda.

6W6PHU3RXo

When i try to remove conda env name display like in FAQ. conda config --set changeps1 False

My oh-my-posh not starting in powershell. 0Va1Fegt42

When i try reload my $Profile oh-my-posh working. But when i restart powershell again oh-my-posh not working. epBQdon1kb

oh-my-posh --init --shell pwsh --config C:\Users\'Harley V2.0'\.config\powershell\HarleyV2.omp.json | Invoke-Expression

Theme

{ "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", "blocks": [ { "alignment": "left", "segments": [ { "background": "#0077c2", "foreground": "#ffffff", "leading_diamond": "\u256d\u2500\ue0b6", "style": "diamond", "template": "{{if .Root}} \uf0e7 {{.UserName}} {{else}} {{.UserName}} {{end}}", "type": "session" }, { "background": "#91ddff", "foreground": "#100e23", "powerline_symbol": "\ue0b0", "properties": { "display_mode": "environment", "fetch_virtual_env": true, "home_enabled": true }, "style": "diamond", "template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ", "type": "python" }, { "background": "#ef5350", "foreground": "#FFFB38", "properties": { "root_icon": "\uf292" }, "style": "diamond", "template": "\ue0b0</> \uf0e7 ", "type": "root" }, { "background": "#444444", "foreground": "#E4E4E4", "powerline_symbol": "\ue0b0", "properties": { "style": "full" }, "style": "powerline", "template": " {{ .Path }} ", "type": "path" }, { "background": "#FFFB38", "background_templates": [ "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb95{{ end }}", "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#c5e478{{ end }}", "{{ if gt .Ahead 0 }}#C792EA{{ end }}", "{{ if gt .Behind 0 }}#C792EA{{ end }}" ], "foreground": "#011627", "powerline_symbol": "\ue0b0", "properties": { "branch_icon": "\ue725 ", "fetch_status": true, "fetch_upstream_icon": true }, "style": "powerline", "template": " {{ .HEAD }} {{ if .Working.Changed }}{{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#ef5350> \uf046 {{ .Staging.String }}</>{{ end }} ", "type": "git" } ], "type": "prompt" }, { "alignment": "right", "segments": [

    {
      "background": "#40c4ff",
      "foreground": "#ffffff",
      "invert_powerline": true,
      "leading_diamond": " \ue0b6",
      "style": "diamond",
      "template": " \uf5ef {{ .CurrentDate | date .Format }} ",
      "trailing_diamond": "\ue0b4",
      "type": "time"
    }
  ],
  "type": "prompt"
},
{
  "alignment": "left",
  "newline": true,
  "segments": [
    {
      "foreground": "#21c7c7",
      "style": "plain",
      "template": "\u2570\u2500",
      "type": "text"
    },
    {
      "foreground": "#e0f8ff",
      "foreground_templates": [
        "{{ if gt .Code 0 }}#ef5350{{ end }}"
      ],
      "properties": {
        "always_enabled": true
      },
      "style": "plain",
      "template": "\u276f ",
      "type": "exit"
    }
  ],
  "type": "prompt"
}

], "version": 2 }

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 12.3.3

Segments:

ConsoleTitle(false) -   0 ms -
session(true)  -   0 ms - ╭─ Harley V2.0
python(true)   -  78 ms -   base 3.8.5
root(false)    -   0 ms -
path(true)     -   0 ms -  ~
git(false)     -  15 ms -
time(true)     -   0 ms -    01:33:05 
text(true)     -   0 ms - ╰─
exit(true)     -   0 ms - ❯

Run duration: 109.3937ms

Cache path: C:\Users\Harley V2.0\AppData\Local\oh-my-posh

Config path: C:\HarleyV2.omp.json

Logs:

2022/10/18 01:33:05 debug: Getenv
C:\Users\Harley V2.0\AppData\Local
2022/10/18 01:33:05 Getenv duration: 0s, args: LOCALAPPDATA
2022/10/18 01:33:05 CachePath duration: 0s, args:
2022/10/18 01:33:05 debug: Getenv
C:\HarleyV2.omp.json
2022/10/18 01:33:05 Getenv duration: 0s, args: POSH_THEME
2022/10/18 01:33:05 debug: Shell
process name: pwsh.exe
2022/10/18 01:33:05 Shell duration: 11.595ms, args:
2022/10/18 01:33:05 resolveConfigPath duration: 11.595ms, args:
2022/10/18 01:33:05 Init duration: 12.0978ms, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 config.loadConfig duration: 997.8µs, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/10/18 01:33:05 WindowsRegistryKeyValue duration: 0s, args: HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: WindowsRegistryKeyValue
ColorizationColor(DWORD): 0xC468768A
2022/10/18 01:33:05 Root duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 ErrorCode duration: 0s, args:
2022/10/18 01:33:05 IsWsl duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: User
Harley V2.0
2022/10/18 01:33:05 User duration: 0s, args:
2022/10/18 01:33:05 debug: Host
DESKTOP-1VP4Q43
2022/10/18 01:33:05 Host duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: SSH_CONNECTION
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: SSH_CLIENT
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: VIRTUAL_ENV
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: CONDA_ENV_PATH
2022/10/18 01:33:05 debug: Getenv
base
2022/10/18 01:33:05 Getenv duration: 0s, args: CONDA_DEFAULT_ENV
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: CommandPath
C:\ProgramData\Anaconda3\python.exe
2022/10/18 01:33:05 CommandPath duration: 0s, args: python
2022/10/18 01:33:05 debug: Getenv

2022/10/18 01:33:05 Getenv duration: 0s, args: PYENV_ROOT
2022/10/18 01:33:05 debug: CommandPath
C:\ProgramData\Anaconda3\python.exe
2022/10/18 01:33:05 CommandPath duration: 0s, args: python
2022/10/18 01:33:05 HasCommand duration: 0s, args: python
2022/10/18 01:33:05 debug: RunCommand
Python 3.8.5
2022/10/18 01:33:05 RunCommand duration: 76.8566ms, args: python --version
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 Root duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 PathSeparator duration: 0s, args:
2022/10/18 01:33:05 IsWsl duration: 0s, args:
2022/10/18 01:33:05 StackCount duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 DirIsWritable duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 debug: CommandPath
C:\Program Files\Git\cmd\git.exe
2022/10/18 01:33:05 CommandPath duration: 14.9998ms, args: git.exe
2022/10/18 01:33:05 HasCommand duration: 15.4994ms, args: git.exe
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/10/18 01:33:05 HasParentFilePath duration: 0s, args: .git
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 debug: Pwd
C:\Users\Harley V2.0
2022/10/18 01:33:05 Pwd duration: 0s, args:
2022/10/18 01:33:05 debug: Home
C:\Users\Harley V2.0
2022/10/18 01:33:05 GOOS duration: 0s, args:
2022/10/18 01:33:05 ErrorCode duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 Shell duration: 0s, args:
2022/10/18 01:33:05 TemplateCache duration: 0s, args:
2022/10/18 01:33:05 debug: Getenv
C:\Users\Harley V2.0\AppData\Local
2022/10/18 01:33:05 Getenv duration: 0s, args: LOCALAPPDATA
2022/10/18 01:33:05 CachePath duration: 0s, args:
2022/10/18 01:33:05 Flags duration: 0s, args:
JanDeDobbeleer commented 1 year ago

@kubilayerislik this isn't a bug in oh-my-posh but probably conda removing all custom prompt functions. Did you add this BEFORE or AFTER initializing oh-my-posh in your $profile?

kubilayerislik commented 1 year ago

I change my conda initialize before oh-my-posh. It works thanks for helping.

github-actions[bot] commented 9 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.