JanDeDobbeleer / oh-my-posh

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

Right aligned prompt spacing broken in Windows Terminal using PowerShell, go functions, and ANSI hyperlink sequences #4222

Closed magma-chili closed 1 year ago

magma-chili commented 1 year ago

Code of Conduct

What happened?

Hi,

Overview

This happens using powershell and pwsh in Windows Terminal version 1.17.114610.

Since version 18.2.3, my customized prompt has had a spacing issue between a customized text (path) segment which renders each folder as a clickable hyperlink to open said folder and a prompt that normally is aligned to the right. I was really happy with the way it worked until this issue started, and I don't know if what I'm seeing is a bug or if I've been abusing a bug as a feature, but I'm guessing my issue came from fix(rprompt): position using spaces instead of ANSI · JanDeDobbeleer/oh-my-posh@181b789 (github.com) or fix(prompt): print right block using spaces · JanDeDobbeleer/oh-my-posh@c23069b (github.com) in version 18.2.3

Example screenshots

oh-my-posh version with issue: 18.2.3+ Pasted image 20230903094109

oh-my-posh version without issue: 18.2.2 Pasted image 20230903095020

Explanation

My powershell profile sets $env:Posh_CWD to the current working directory path string.

function prompt {
  # Path. Always converts path root to provider name. Needed for per-folder hyperlinks handled by oh-my-posh code.
  $env:Posh_CWD = $PWD.ProviderPath
  if (-not $env:Posh_CWD) {
    $env:Posh_CWD = $PWD.Path
  }
  if ($PWD.Provider.Name -eq 'Registry') {
    # Get-Item converts '\' in registry key names to '/'
    $env:Posh_CWD = Get-Item . | Select-Object -ExpandProperty Name
  }
  if ($PWD.Drive.Root) {
    $env:Posh_CWD = [regex]::Replace($env:Posh_CWD, 
      "^$([regex]::Escape($PWD.Drive.Root.TrimEnd('\')))(\\)?", "$($PWD.Drive.Name):\")
  }
  $env:Posh_CWD = $env:Posh_CWD.TrimStart('\\').TrimEnd('\')
}
# OUTPUT of $env:Posh_CWD: C:\Users\Elevated

The go template code is ugly to my eyes in JSON format, but the text template operating on .Env.Posh_CWD in the codeblock below splits the path and loops through each segment, creating links in between custom separators.

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "palette": {
    "muted-black": "#202020",
    "muted-white": "#A0A0A0"
  },
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "diamond",
          "foreground": "black",
          "background": "white",
          "trailing_diamond": "\uE0B0",
          "template": "<black,white>{{ $segments := splitList \"\\\\\" .Env.Posh_CWD }}{{ range $i, $e := $segments }}{{ if $i }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\uE0B0</><transparent,background>\uE0B0</> {{ else }} <black,white>\uE0B1 {{end}}{{ end }}{{ $path := slice $segments 0 (add 1 $i) | join \"\\\\\" }}{{ $label := \"\" }}{{ if eq $i 0 }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\uE0B0</><transparent,background>\uE0B0</> {{ else }} <black,white>\uE0B1 {{end}}{{ $label = $e }}{{ else if and (gt (len $e) 7) (not (eq (add 1 $i) (len $segments))) }}{{ $label = \"\uF74A\" }}{{ else if and (gt (len $e) 64) ((eq (add 1 $i) (len $segments))) }}{{ $label = cat (substr 0 63 $e) \"\u0008...\" }}{{ else }}{{ $label = $e }}{{ end }}\u001B]8;;file://{{ $path }}\u001B\\{{ $label }}\u001B]8;;\u001B\\{{ end }} ",
          "background_templates": ["#{{ .Env.Posh_CWDColor }}"]
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "session",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background_templates": ["{{ if .Root }}red{{ else }}p:muted-white{{ end }}"],
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "",
          "template": " {{ .UserName }} \uE0B3 {{ if .Root }}<lightWhite>\uE614</>{{ else }}\uF007{{ end}}<transparent,background> \uE0B2</>"
        },
        {
          "type": "session",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "leading_diamond": "\uE0B2",
          "template": " {{ .HostName }} \uE0B3"
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "trailing_diamond": "<transparent,background>\uE0B2</>",
          "properties": {
            "windows": "\uF871"
          }
        }
      ]
    }
  ]
}

Bug or misconfiguration?

Is there something wrong with the way I am doing this or is this a bug?

Theme

A custom config I designed called blades.omp.json which requires a lot of extra powershell code in the powershell profile file to work.

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "version": 2,
  "final_space": true,
  "palette": {
    "muted-black": "#202020",
    "muted-white": "#A0A0A0"
  },
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "diamond",
          "foreground": "black",
          "foreground_templates": ["{{ if eq (.Env.Posh_StackColor | int) 1 }}red{{ end }}"],
          "background": "white",
          "leading_diamond": "\u001B[0m\uE0B6",
          "template": "\u0000"
        },
        {
          "type": "text",
          "style": "diamond",
          "foreground": "parentForeground",
          "background": "white",
          "template": " {{ if eq (.Env.Posh_StackCount | int) -2 }}\uF74B{{ else if eq (.Env.Posh_StackCount | int) -1 }}\uF7C9{{ else if eq (.Env.Posh_StackCount | int) 0 }}\uFB44{{ else if eq (.Env.Posh_StackCount | int) 1 }}\uF8A5{{ else if eq (.Env.Posh_StackCount | int) 2 }}\uF8A7{{ else if eq (.Env.Posh_StackCount | int) 3 }}\uF8AA{{ else if eq (.Env.Posh_StackCount | int) 4 }}\uF8AD{{ else if eq (.Env.Posh_StackCount | int) 5 }}\uF8B0{{ else if eq (.Env.Posh_StackCount | int) 6 }}\uF8B3{{ else if eq (.Env.Posh_StackCount | int) 7 }}\uF8B6{{ else if eq (.Env.Posh_StackCount | int) 8 }}\uF8B9{{ else if eq (.Env.Posh_StackCount | int) 9 }}\uF8BC{{ else if gt (.Env.Posh_StackCount | int) 9 }}\uF8BF{{ else }}\uFB44{{ end }} "
        },
        {
          "type": "text",
          "style": "diamond",
          "foreground": "black",
          "background": "white",
          "trailing_diamond": "\uE0B0",
          "template": "<black,white>{{ $segments := splitList \"\\\\\" .Env.Posh_CWD }}{{ range $i, $e := $segments }}{{ if $i }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\uE0B0</><transparent,background>\uE0B0</> {{ else }} <black,white>\uE0B1 {{end}}{{ end }}{{ $path := slice $segments 0 (add 1 $i) | join \"\\\\\" }}{{ $label := \"\" }}{{ if eq $i 0 }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\uE0B0</><transparent,background>\uE0B0</> {{ else }} <black,white>\uE0B1 {{end}}{{ $label = $e }}{{ else if and (gt (len $e) 7) (not (eq (add 1 $i) (len $segments))) }}{{ $label = \"\uF74A\" }}{{ else if and (gt (len $e) 64) ((eq (add 1 $i) (len $segments))) }}{{ $label = cat (substr 0 63 $e) \"\u0008...\" }}{{ else }}{{ $label = $e }}{{ end }}\u001B]8;;file://{{ $path }}\u001B\\{{ $label }}\u001B]8;;\u001B\\{{ end }} ",
          "background_templates": ["#{{ .Env.Posh_CWDColor }}"]
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "white",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}magenta{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}white{{ end }}",
            "{{ if gt .Ahead 0 }}green{{ end }}",
            "{{ if gt .Behind 0 }}red{{ end }}"
          ],
          "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}",
          "properties": {
            "fetch_status": true,
            "fetch_stash_count": true,
            "fetch_upstream_icon": true
          }
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "session",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background_templates": ["{{ if .Root }}red{{ else }}p:muted-white{{ end }}"],
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "",
          "template": " {{ .UserName }} \uE0B3 {{ if .Root }}<lightWhite>\uE614</>{{ else }}\uF007{{ end}}<transparent,background> \uE0B2</>"
        },
        {
          "type": "session",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "leading_diamond": "\uE0B2",
          "template": " {{ .HostName }} \uE0B3"
        },
        {
          "type": "os",
          "style": "diamond",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "trailing_diamond": "<transparent,background>\uE0B2</>",
          "properties": {
            "windows": "\uF871"
          }
        },
        {
          "type": "text",
          "style": "diamond",
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "\uE0B4",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "template": " {{ if (eq (.Env.Posh_Chassis | int) 3) }}\uF108 {{ else if (eq (.Env.Posh_Chassis | int) 5) }}\uE22D {{ else if or (eq (.Env.Posh_Chassis | int) 6) (eq (.Env.Posh_Chassis | int) 7) }}\uF6C4 {{ else if (eq (.Env.Posh_Chassis | int) 8) }}\uF108 {{ else if (eq (.Env.Posh_Chassis | int) 9) }}\uF824 {{ else if (eq (.Env.Posh_Chassis | int) 10) }}\uF822 {{ else if (eq (.Env.Posh_Chassis | int) 11) }}\uF61C {{ else if (eq (.Env.Posh_Chassis | int) 12) }}\uF109 {{ else if (eq (.Env.Posh_Chassis | int) 13) }}\uF6C3 {{ else if (eq (.Env.Posh_Chassis | int) 14) }}\uF822 {{ else if (eq (.Env.Posh_Chassis | int) 15) }}\uFCBE {{ else if (eq (.Env.Posh_Chassis | int) 16) }}\uE28D {{ else if or (eq (.Env.Posh_Chassis | int) 1) (eq (.Env.Posh_Chassis | int) 2) (eq (.Env.Posh_Chassis | int) 4) (eq (.Env.Posh_Chassis | int) 15) (eq (.Env.Posh_Chassis | int) 17) (eq (.Env.Posh_Chassis | int) 18) (eq (.Env.Posh_Chassis | int) 19) (eq (.Env.Posh_Chassis | int) 20) (eq (.Env.Posh_Chassis | int) 21) (eq (.Env.Posh_Chassis | int) 22) (eq (.Env.Posh_Chassis | int) 23) (eq (.Env.Posh_Chassis | int) 24) }}\uF473 {{ else }}\uF473 {{ end }}"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "diamond",
          "foreground": "transparent",
          "background": "white",
          "leading_diamond": " <foreground,background>\uE0B4</>",
          "template": "\u0000 <foreground,background>\uE0B6</>"
        },
        {
          "type": "text",
          "style": "plain",
          "foreground": "darkGray",
          "template": "{{ if .Env.Posh_Provider }}<i>{{ .Env.Posh_Provider }}</i>{{ end }}"
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "time",
          "style": "plain",
          "foreground": "darkGray",
          "properties": {
            "time_format": "<i>2006-01-02T15:04:05.000Z</i>"
          },
          "template": "{{ dateInZone \"<i>2006-01-02T15:04:05.000Z</i>\" .CurrentDate \"UTC\" }}"
        },
        {
          "type": "text",
          "style": "diamond",
          "foreground": "transparent",
          "background": "p:muted-white",
          "leading_diamond": "<foreground,background>\uE0B4</>",
          "trailing_diamond": "",
          "template": " \u0000<foreground,background>\uE0B6</>"
        },
        {
          "type": "text",
          "style": "plain",
          "foreground": "#2b2b2b",
          "template": "{{ if lt (len .Env.Posh_ExecutionTime) 6 }}{{ repeat ((sub 5 (len .Env.Posh_ExecutionTime)) | int) \" \" }}{{ end }}<i>{{ .Env.Posh_ExecutionTime }}</i> "
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "shell",
          "style": "diamond",
          "leading_diamond": "\uE0B6<foreground,background> \uF68C  \uE0B1</>",
          "foreground": "black",
          "background": "white",
          "properties": {
            "mapped_shell_names": {
              "pwsh": "PS",
              "powershell": "WPS"
            }
          }
        },
        {
          "type": "text",
          "style": "diamond",
          "leading_diamond": "<foreground,background>\uE0B1 </>",
          "trailing_diamond": "\uE0B0",
          "foreground": "black",
          "background": "white",
          "template": "{{ .Env.Posh_PSVersion }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "lightGreen",
          "template": " {{ if eq .Env.Posh_PSDebug \"Break\" }}\uF8E3{{ end }}{{ if eq .Env.Posh_PSDebug \"Continue\" }}\uF129{{ end }}{{ if eq .Env.Posh_PSDebug \"Ignore\" }}\uF466 {{ end }}{{ if eq .Env.Posh_PSDebug \"Inquire\" }}\uF128{{ end }}{{ if eq .Env.Posh_PSDebug \"Stop\" }}\uF04D {{ end }}{{ if eq .Env.Posh_PSDebug \"SilentlyContinue\" }}\uF026{{ end }}{{ if eq .Env.Posh_PSDebug \"Suspend\" }}\u23FE{{ end }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "lightRed",
          "template": " {{ if eq .Env.Posh_PSError \"Break\" }}\uF8E3{{ end }}{{ if eq .Env.Posh_PSError \"Continue\" }}\uF129{{ end }}{{ if eq .Env.Posh_PSError \"Ignore\" }}\uF466 {{ end }}{{ if eq .Env.Posh_PSError \"Inquire\" }}\uF128{{ end }}{{ if eq .Env.Posh_PSError \"Stop\" }}\uF04D {{ end }}{{ if eq .Env.Posh_PSError \"SilentlyContinue\" }}\uF026{{ end }}{{ if eq .Env.Posh_PSError \"Suspend\" }}\u23FE{{ end }}{{ if eq .Env.Posh_PSError \"CategoryView\" }}\uF068{{ end }}{{ if eq .Env.Posh_PSError \"NormalView\" }}\uF067{{ end }}{{ if eq .Env.Posh_PSError \"DetailedView\" }}\uE612{{ end }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "lightCyan",
          "template": " {{ if eq .Env.Posh_PSInformation \"Break\" }}\uF8E3{{ end }}{{ if eq .Env.Posh_PSInformation \"Continue\" }}\uF129{{ end }}{{ if eq .Env.Posh_PSInformation \"Ignore\" }}\uF466 {{ end }}{{ if eq .Env.Posh_PSInformation \"Inquire\" }}\uF128{{ end }}{{ if eq .Env.Posh_PSInformation \"Stop\" }}\uF04D {{ end }}{{ if eq .Env.Posh_PSInformation \"SilentlyContinue\" }}\uF026{{ end }}{{ if eq .Env.Posh_PSInformation \"Suspend\" }}\u23FE{{ end }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "lightYellow",
          "template": " {{ if eq .Env.Posh_PSVerbose \"Break\" }}\uF8E3{{ end }}{{ if eq .Env.Posh_PSVerbose \"Continue\" }}\uF129{{ end }}{{ if eq .Env.Posh_PSVerbose \"Ignore\" }}\uF466 {{ end }}{{ if eq .Env.Posh_PSVerbose \"Inquire\" }}\uF128{{ end }}{{ if eq .Env.Posh_PSVerbose \"Stop\" }}\uF04D {{ end }}{{ if eq .Env.Posh_PSVerbose \"SilentlyContinue\" }}\uF026{{ end }}{{ if eq .Env.Posh_PSVerbose \"Suspend\" }}\u23FE{{ end }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "lightMagenta",
          "template": " {{ if eq .Env.Posh_PSWarning \"Break\" }}\uF8E3{{ end }}{{ if eq .Env.Posh_PSWarning \"Continue\" }}\uF129{{ end }}{{ if eq .Env.Posh_PSWarning \"Ignore\" }}\uF466 {{ end }}{{ if eq .Env.Posh_PSWarning \"Inquire\" }}\uF128{{ end }}{{ if eq .Env.Posh_PSWarning \"Stop\" }}\uF04D {{ end }}{{ if eq .Env.Posh_PSWarning \"SilentlyContinue\" }}\uF026{{ end }}{{ if eq .Env.Posh_PSWarning \"Suspend\" }}\u23FE{{ end }} "
        },
        {
          "type": "text",
          "style": "powerline",
          "powerline_symbol": "\uE0B0",
          "foreground": "black",
          "background": "white",
          "template": " {{ if eq .Env.Posh_PSWhatIf \"True\" }}\uF129{{ end }} "
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "right",
      "segments": [
        {
          "type": "exit",
          "style": "diamond",
          "foreground": "black",
          "background": "p:muted-white",
          "background_templates": ["{{ if or (gt .Code 0) (lt .Code 0) }}lightRed{{ end }}"],
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "",
          "template": " {{ if or (gt .Code 0) (lt .Code 0) }}{{ if or (gt .Code 1) (lt .Code 0) }}{{ .Code }} \uE0B3 {{ end }}\uF705 <transparent,lightRed>{{ else }}\uF705 <transparent,p:muted-white>{{ end }}\uE0B2</>"
        },
        {
          "type": "executiontime",
          "style": "diamond",
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "<foreground,background>\uE0B3 \uFBAB\u2800</><transparent,background>\uE0B2</>",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "properties": {
            "threshold": 1
          }
        },
        {
          "type": "text",
          "style": "diamond",
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "<foreground,background> \uE0B3 \uF698 </><transparent,background>\uE0B2</>",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "template": " {{ .Env.Posh_HistoryId }}"
        },
        {
          "type": "text",
          "style": "diamond",
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "<foreground,background> \uE0B3 \uF85A </><transparent,background>\uE0B2</>",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "template": " {{ .Env.Posh_WS }}"
        },
        {
          "type": "text",
          "style": "diamond",
          "leading_diamond": "\uE0B2",
          "trailing_diamond": "\uE0B4     ",
          "foreground": "p:muted-black",
          "background": "p:muted-white",
          "template": " {{ .Env.Posh_PID }} \uE0B3 \uFB13 "
        }
      ]
    },
    {
      "type": "prompt",
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "type": "text",
          "style": "diamond",
          "foreground": "white",
          "background": "transparent",
          "prefix": "",
          "template": "\n{{ repeat (.Env.Posh_PSNestedPromptLevel | int) \"\uE0B1\" }}"
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Version: 18.6.1

Shell: pwsh

Prompt:

 פּ : invalid value; expected string                                        Elevated    DESKTOP-72OUA3V     
                                                                                        2023-09-03T14:40:41.449Z   167
    PS                                                                                                        ﬓ 

Segments:

ConsoleTitle(false) -   0 ms
Text(true)          -   0 ms
Text(true)          -   0 ms
Text(true)          -   0 ms
Git(false)          -  15 ms
Session(true)       -   0 ms
Session(true)       -   0 ms
Os(true)            -   0 ms
Text(true)          -   0 ms
Text(true)          -   0 ms
Text(false)         -   0 ms
Time(true)          -   0 ms
Text(true)          -   0 ms
Text(true)          -   0 ms
Shell(true)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Exit(false)         -   0 ms
Executiontime(false) -   0 ms
Text(false)         -   0 ms
Text(false)         -   0 ms
Text(true)          -   0 ms
Text(true)          -   0 ms

Run duration: 39.2909ms

Cache path: C:\Users\Elevated\AppData\Local\oh-my-posh

Config path: C:\Users\Limited\Workspace\VS Code\Oh My Posh\Themes 📌\blades.omp.json

Logs:

[DEBUG] 10:40:41.415 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.415 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 10:40:41.415 shell.go:Getenv:392 → C:\Users\Elevated\AppData\Local
[TRACE] 10:40:41.415 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 10:40:41.415 shell_windows.go:CachePath() - 222.7µs
[DEBUG] 10:40:41.415 shell.go:Shell:632 → no shell name provided in flags, trying to detect it
[DEBUG] 10:40:41.425 shell.go:Shell:640 → process name: pwsh.exe
[TRACE] 10:40:41.425 shell.go:Shell() - 9.7266ms
[TRACE] 10:40:41.425 shell.go:resolveConfigPath() - 9.7266ms
[TRACE] 10:40:41.425 shell.go:Init() - 10.157ms
[TRACE] 10:40:41.425 shell.go:Flags() - 0s
[TRACE] 10:40:41.427 config.go:loadConfig() - 2.1802ms
[TRACE] 10:40:41.427 shell.go:Flags() - 0s
[DEBUG] 10:40:41.428 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.428 shell.go:Getenv(OMP_CACHE_DISABLED) - 179.8µs
[TRACE] 10:40:41.428 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.428 shell_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC4E81123
[TRACE] 10:40:41.428 shell.go:Shell() - 0s
[DEBUG] 10:40:41.428 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.428 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 10:40:41.428 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 10:40:41.428 text.go:Render:70 → Rendering template:
[DEBUG] 10:40:41.428 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.428 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 10:40:41.428 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.428 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[TRACE] 10:40:41.428 shell.go:Shell() - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:Flags() - 0s
[DEBUG] 10:40:41.428 shell.go:Pwd:422 → C:\Users\Limited
[TRACE] 10:40:41.428 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.428 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.428 segment.go:SetEnabled:494 → Segment: Git
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[TRACE] 10:40:41.428 shell.go:Pwd() - 0s
[TRACE] 10:40:41.428 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.428 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.428 shell.go:Pwd() - 0s
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.428 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.428 segment.go:SetEnabled:494 → Segment: Text
[DEBUG] 10:40:41.428 shell_windows.go:56 → C:\Users\Elevated
[DEBUG] 10:40:41.428 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.428 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.428 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.428 shell_windows.go:Root() - 0s
[TRACE] 10:40:41.428 shell.go:Shell() - 0s
[TRACE] 10:40:41.428 shell.go:StatusCodes() - 0s
[TRACE] 10:40:41.428 shell_windows.go:IsWsl() - 0s
[DEBUG] 10:40:41.429 shell.go:TemplateCache:813 → environment: [ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\Elevated\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey ChocolateyLastPathUpdate="133368059741360986" ChocolateyToolsLocation=C:\tools CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=DESKTOP-72OUA3V ComSpec=C:\WINDOWS\system32\cmd.exe DOTNET_CLI_TELEMETRY_OPTOUT=true DOTNET_ROOT=C:\Program Files\dotnet DriverData=C:\Windows\System32\Drivers\DriverData GOPATH=C:\Users\Elevated\go LOCALAPPDATA=C:\Users\Elevated\AppData\Local NUMBER_OF_PROCESSORS=8 NVIDIAWHITELISTED=0x01 OneDrive=C:\Users\Elevated\OneDrive OPENSSL_CONF=C:\Program Files\OpenSSL-Win64\bin\openssl.cfg OS=Windows_NT Path=C:\Program Files\PowerShell\7;C:\Python311\Scripts\;C:\Python311\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\ProgramData\chocolatey\bin;C:\Program Files (x86)\oh-my-posh\bin;C:\Program Files\PuTTY\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\PowerShell\7\;C:\tools\NirLauncher\Nirsoft;C:\Program Files\Cloudflare\Cloudflare WARP\;C:\Program Files\Calibre2\;C:\Program Files\Go\bin;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Users\Elevated\AppData\Local\Programs\Python\Python312\Scripts\;C:\Users\Elevated\AppData\Local\Programs\Python\Python312\;C:\Users\Elevated\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Nmap;C:\Program Files (x86)\Microsoft Security Compliance Toolkit 1.0\LGPO\LGPO_30;C:\Program Files (x86)\Microsoft Security Compliance Toolkit 1.0\PolicyAnalyzer\PolicyAnalyzer_40;C:\Program Files (x86)\Microsoft Security Compliance Toolkit 1.0\SetObjectSecurity\SetObjectSecurity_10;C:\Users\Elevated\AppData\Local\Microsoft\WindowsApps;C:\Users\Elevated\.dotnet\tools;C:\Users\Elevated\AppData\Local\Programs\oh-my-posh\bin;C:\Users\Elevated\AppData\Local\Programs\oh-my-posh\themes;C:\Program Files\JanDeDobbeleer\oh-my-posh\bin;C:\Program Files\JanDeDobbeleer\oh-my-posh\themes;C:\Users\Elevated\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Elevated\AppData\Local\Microsoft\WinGet\Links;C:\Users\Elevated\AppData\Local\Pandoc\;C:\Program Files\Neovim\bin;C:\Program Files\OpenSSL-Win64\bin;C:\Users\Elevated\go\bin;C:\Users\Elevated\AppData\Roaming\npm PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL posh_debug=True Posh_ExecutionTime=167 POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Pro PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 126 Stepping 5, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=7e05 PROFILEMODULE=C:\Users\Elevated\Documents\PowerShell\Modules\PowerShellSharedProfile\PowerShellSharedProfile.psm1 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\Elevated\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules PUBLIC=C:\Users\Public SHIM_MCCOMPAT=0x810000001 SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\Elevated\AppData\Local\Temp TMP=C:\Users\Elevated\AppData\Local\Temp USERDOMAIN=DESKTOP-72OUA3V USERNAME=Elevated USERNAME_SESSION=Limited USERNAME_SESSION_NT_AUTHORIZATION_GROUPS=Everyone, NT AUTHORITY\Authenticated Users, BUILTIN\Users, NT AUTHORITY\INTERACTIVE USERPROFILE=C:\Users\Elevated windir=C:\WINDOWS WSLENV=WT_SESSION::WT_PROFILE_ID WT_PROFILE_ID={574e775e-4f2a-5b96-ac1e-a2962a402336} WT_SESSION=976064f8-1748-455d-b1f3-51173c1dd43a]
[TRACE] 10:40:41.429 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.429 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.429 shell.go:User:543 → Elevated
[TRACE] 10:40:41.429 shell.go:User() - 0s
[DEBUG] 10:40:41.429 shell.go:Host:555 → DESKTOP-72OUA3V
[TRACE] 10:40:41.429 shell.go:Host() - 0s
[TRACE] 10:40:41.429 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.429 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.429 shell.go:Getenv(SHLVL) - 0s
[TRACE] 10:40:41.429 shell.go:TemplateCache() - 886.5µs
[TRACE] 10:40:41.429 shell.go:TemplateCache() - 886.5µs
[TRACE] 10:40:41.429 shell.go:TemplateCache() - 886.5µs
[DEBUG] 10:40:41.443 shell.go:CommandPath:594 → C:\Program Files\Git\cmd\git.exe
[TRACE] 10:40:41.443 shell.go:CommandPath(git.exe) - 15.0332ms
[TRACE] 10:40:41.443 shell.go:HasCommand(git.exe) - 15.0332ms
[TRACE] 10:40:41.443 shell.go:Pwd() - 0s
[ERROR] 10:40:41.444 shell.go:HasParentFilePath:728 → CreateFile .git: The system cannot find the file specified.
[TRACE] 10:40:41.444 shell.go:HasParentFilePath(.git) - 588.2µs
[DEBUG] 10:40:41.444 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 10:40:41.444 text.go:Render:70 → Rendering template:
[TRACE] 10:40:41.444 shell.go:Shell() - 0s
[DEBUG] 10:40:41.444 text.go:Render:70 → Rendering template: <black,white>{{ $segments := splitList "\\" .Env.Posh_CWD }}{{ range $i, $e := $segments }}{{ if $i }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent></><transparent,background></> {{ else }} <black,white> {{end}}{{ end }}{{ $path := slice $segments 0 (add 1 $i) | join "\\" }}{{ $label := "" }}{{ if eq $i 0 }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent></><transparent,background></> {{ else }} <black,white> {{end}}{{ $label = $e }}{{ else if and (gt (len $e) 7) (not (eq (add 1 $i) (len $segments))) }}{{ $label = "" }}{{ else if and (gt (len $e) 64) ((eq (add 1 $i) (len $segments))) }}{{ $label = cat (substr 0 63 $e) ..." }}{{ else }}{{ $label = $e }}{{ end }}{{ $label }}{{ end }}
[DEBUG] 10:40:41.444 text.go:Render:70 → Rendering template:  {{ if eq (.Env.Posh_StackCount | int) -2 }}{{ else if eq (.Env.Posh_StackCount | int) -1 }}{{ else if eq (.Env.Posh_StackCount | int) 0 }}פּ{{ else if eq (.Env.Posh_StackCount | int) 1 }}{{ else if eq (.Env.Posh_StackCount | int) 2 }}{{ else if eq (.Env.Posh_StackCount | int) 3 }}{{ else if eq (.Env.Posh_StackCount | int) 4 }}{{ else if eq (.Env.Posh_StackCount | int) 5 }}{{ else if eq (.Env.Posh_StackCount | int) 6 }}{{ else if eq (.Env.Posh_StackCount | int) 7 }}{{ else if eq (.Env.Posh_StackCount | int) 8 }}{{ else if eq (.Env.Posh_StackCount | int) 9 }}{{ else if gt (.Env.Posh_StackCount | int) 9 }}{{ else }}פּ{{ end }}
[TRACE] 10:40:41.446 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.446 shell.go:Shell() - 0s
[TRACE] 10:40:41.446 shell.go:TemplateCache() - 0s
[ERROR] 10:40:41.446 text.go:Render:86 → template: <black,white>{{ $segments := splitList "\\" .Env.Posh_CWD }}{{ range $i, $e := $segments }}{{ if $i }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent></><transparent,background></> {{ else }} <black,white> {{end}}{{ end }}{{ $path := slice $segments 0 (add 1 $i) | join "\\" }}{{ $label := "" }}{{ if eq $i 0 }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent></><transparent,background></> {{ else }} <black,white> {{end}}{{ $label = $e }}{{ else if and (gt (len $e) 7) (not (eq (add 1 $i) (len $segments))) }}{{ $label = "" }}{{ else if and (gt (len $e) 64) ((eq (add 1 $i) (len $segments))) }}{{ $label = cat (substr 0 63 $e) ..." }}{{ else }}{{ $label = $e }}{{ end }}{{ $label }}{{ end }} :1:48: executing "<black,white>{{ $segments := splitList \"\\\\\" .Env.Posh_CWD }}{{ range $i, $e := $segments }}{{ if $i }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\ue0b0</><transparent,background>\ue0b0</> {{ else }} <black,white>\ue0b1 {{end}}{{ end }}{{ $path := slice $segments 0 (add 1 $i) | join \"\\\\\" }}{{ $label := \"\" }}{{ if eq $i 0 }}{{ if (eq (add 1 $i) (len $segments)) }} <white,transparent>\ue0b0</><transparent,background>\ue0b0</> {{ else }} <black,white>\ue0b1 {{end}}{{ $label = $e }}{{ else if and (gt (len $e) 7) (not (eq (add 1 $i) (len $segments))) }}{{ $label = \"\uf74a\" }}{{ else if and (gt (len $e) 64) ((eq (add 1 $i) (len $segments))) }}{{ $label = cat (substr 0 63 $e) \"\b...\" }}{{ else }}{{ $label = $e }}{{ end }}\x1b]8;;file://{{ $path }}\x1b\\{{ $label }}\x1b]8;;\x1b\\{{ end }} " at <.Env.Posh_CWD>: invalid value; expected string
[TRACE] 10:40:41.446 shell.go:Shell() - 0s
[DEBUG] 10:40:41.446 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.446 shell.go:Getenv(TERM_PROGRAM) - 537.9µs
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: {{ if eq (.Env.Posh_StackColor | int) 1 }}red{{ end }}
[TRACE] 10:40:41.446 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: #{{ .Env.Posh_CWDColor }}
[TRACE] 10:40:41.446 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.446 text.go:Render:70 → Rendering template: powerline
[TRACE] 10:40:41.446 shell.go:Shell() - 0s
[TRACE] 10:40:41.446 shell.go:Shell() - 0s
[TRACE] 10:40:41.446 shell.go:Flags() - 0s
[TRACE] 10:40:41.446 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.446 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.446 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.446 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.446 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.446 shell.go:Flags() - 0s
[TRACE] 10:40:41.446 shell.go:Flags() - 0s
[TRACE] 10:40:41.446 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.446 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.446 shell.go:GOOS() - 0s
[TRACE] 10:40:41.446 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.446 segment.go:SetEnabled:494 → Segment: Os
[TRACE] 10:40:41.446 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.447 shell_windows.go:56 → C:\Users\Elevated
[DEBUG] 10:40:41.447 properties.go:GetString:28 → 
[TRACE] 10:40:41.447 shell.go:GOOS() - 0s
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.447 segment.go:SetEnabled:494 → Segment: Session
[DEBUG] 10:40:41.447 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.447 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 10:40:41.447 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.447 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 10:40:41.447 shell.go:Flags() - 0s
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.447 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.447 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.447 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.447 segment.go:SetEnabled:494 → Segment: Session
[DEBUG] 10:40:41.447 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.447 shell.go:Getenv(SSH_CONNECTION) - 0s
[DEBUG] 10:40:41.447 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.447 shell.go:Getenv(SSH_CLIENT) - 0s
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.447 text.go:Render:70 → Rendering template:  {{ .UserName }}  {{ if .Root }}<lightWhite></>{{ else }}{{ end}}<transparent,background> </>
[DEBUG] 10:40:41.447 text.go:Render:70 → Rendering template:  {{ if (eq (.Env.Posh_Chassis | int) 3) }} {{ else if (eq (.Env.Posh_Chassis | int) 5) }} {{ else if or (eq (.Env.Posh_Chassis | int) 6) (eq (.Env.Posh_Chassis | int) 7) }} {{ else if (eq (.Env.Posh_Chassis | int) 8) }} {{ else if (eq (.Env.Posh_Chassis | int) 9) }} {{ else if (eq (.Env.Posh_Chassis | int) 10) }} {{ else if (eq (.Env.Posh_Chassis | int) 11) }} {{ else if (eq (.Env.Posh_Chassis | int) 12) }} {{ else if (eq (.Env.Posh_Chassis | int) 13) }} {{ else if (eq (.Env.Posh_Chassis | int) 14) }} {{ else if (eq (.Env.Posh_Chassis | int) 15) }}ﲾ {{ else if (eq (.Env.Posh_Chassis | int) 16) }} {{ else if or (eq (.Env.Posh_Chassis | int) 1) (eq (.Env.Posh_Chassis | int) 2) (eq (.Env.Posh_Chassis | int) 4) (eq (.Env.Posh_Chassis | int) 15) (eq (.Env.Posh_Chassis | int) 17) (eq (.Env.Posh_Chassis | int) 18) (eq (.Env.Posh_Chassis | int) 19) (eq (.Env.Posh_Chassis | int) 20) (eq (.Env.Posh_Chassis | int) 21) (eq (.Env.Posh_Chassis | int) 22) (eq (.Env.Posh_Chassis | int) 23) (eq (.Env.Posh_Chassis | int) 24) }} {{ else }} {{ end }}
[DEBUG] 10:40:41.447 text.go:Render:70 → Rendering template:  {{ .HostName }} 
[DEBUG] 10:40:41.447 text.go:Render:70 → Rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.447 shell.go:Shell() - 0s
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.447 shell.go:Shell() - 0s
[TRACE] 10:40:41.447 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.448 shell.go:Shell() - 0s
[TRACE] 10:40:41.448 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.448 shell.go:Shell() - 0s
[DEBUG] 10:40:41.448 text.go:Render:70 → Rendering template: {{ if .Root }}red{{ else }}p:muted-white{{ end }}
[TRACE] 10:40:41.448 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.448 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.448 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.448 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.448 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.449 shell_windows.go:TerminalWidth:109 → terminal width: 123
[TRACE] 10:40:41.449 shell_windows.go:TerminalWidth() - 582.2µs
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[TRACE] 10:40:41.449 shell.go:Flags() - 0s
[TRACE] 10:40:41.449 shell.go:Pwd() - 0s
[TRACE] 10:40:41.449 shell.go:Flags() - 0s
[DEBUG] 10:40:41.449 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.449 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.449 segment.go:SetEnabled:494 → Segment: Text
[DEBUG] 10:40:41.449 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.449 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.449 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.449 text.go:Render:70 → Rendering template: {{ if .Env.Posh_Provider }}<i>{{ .Env.Posh_Provider }}</i>{{ end }}
[DEBUG] 10:40:41.449 text.go:Render:70 → Rendering template:  <foreground,background></>
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[DEBUG] 10:40:41.449 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.449 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 10:40:41.449 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.449 text.go:Render:70 → Rendering template: plain
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[TRACE] 10:40:41.449 shell.go:Shell() - 0s
[TRACE] 10:40:41.449 shell.go:Flags() - 0s
[TRACE] 10:40:41.449 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.449 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.449 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.449 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.449 shell.go:Flags() - 0s
[TRACE] 10:40:41.449 shell.go:Flags() - 0s
[TRACE] 10:40:41.449 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.449 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.449 shell.go:GOOS() - 0s
[TRACE] 10:40:41.449 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.449 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.449 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.449 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.449 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.449 segment.go:SetEnabled:494 → Segment: Time
[DEBUG] 10:40:41.449 properties.go:GetString:28 → <i>2006-01-02T15:04:05.000Z</i>
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: {{ if lt (len .Env.Posh_ExecutionTime) 6 }}{{ repeat ((sub 5 (len .Env.Posh_ExecutionTime)) | int) " " }}{{ end }}<i>{{ .Env.Posh_ExecutionTime }}</i>
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: {{ dateInZone "<i>2006-01-02T15:04:05.000Z</i>" .CurrentDate "UTC" }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  <foreground,background></>
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: plain
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: plain
[DEBUG] 10:40:41.450 shell_windows.go:TerminalWidth:92 → terminal width: 123
[TRACE] 10:40:41.450 shell_windows.go:TerminalWidth() - 0s
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[TRACE] 10:40:41.450 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[DEBUG] 10:40:41.450 properties.go:GetKeyValueMap:46 → mapped_shell_names: map[powershell:WPS pwsh:PS]
[DEBUG] 10:40:41.450 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.450 shell.go:Shell() - 0s
[TRACE] 10:40:41.450 shell.go:GOOS() - 0s
[TRACE] 10:40:41.450 shell.go:Flags() - 0s
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.450 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.450 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSWhatIf "True" }}{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSVerbose "Break" }}{{ end }}{{ if eq .Env.Posh_PSVerbose "Continue" }}{{ end }}{{ if eq .Env.Posh_PSVerbose "Ignore" }} {{ end }}{{ if eq .Env.Posh_PSVerbose "Inquire" }}{{ end }}{{ if eq .Env.Posh_PSVerbose "Stop" }} {{ end }}{{ if eq .Env.Posh_PSVerbose "SilentlyContinue" }}{{ end }}{{ if eq .Env.Posh_PSVerbose "Suspend" }}⏾{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSWarning "Break" }}{{ end }}{{ if eq .Env.Posh_PSWarning "Continue" }}{{ end }}{{ if eq .Env.Posh_PSWarning "Ignore" }} {{ end }}{{ if eq .Env.Posh_PSWarning "Inquire" }}{{ end }}{{ if eq .Env.Posh_PSWarning "Stop" }} {{ end }}{{ if eq .Env.Posh_PSWarning "SilentlyContinue" }}{{ end }}{{ if eq .Env.Posh_PSWarning "Suspend" }}⏾{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSInformation "Break" }}{{ end }}{{ if eq .Env.Posh_PSInformation "Continue" }}{{ end }}{{ if eq .Env.Posh_PSInformation "Ignore" }} {{ end }}{{ if eq .Env.Posh_PSInformation "Inquire" }}{{ end }}{{ if eq .Env.Posh_PSInformation "Stop" }} {{ end }}{{ if eq .Env.Posh_PSInformation "SilentlyContinue" }}{{ end }}{{ if eq .Env.Posh_PSInformation "Suspend" }}⏾{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSDebug "Break" }}{{ end }}{{ if eq .Env.Posh_PSDebug "Continue" }}{{ end }}{{ if eq .Env.Posh_PSDebug "Ignore" }} {{ end }}{{ if eq .Env.Posh_PSDebug "Inquire" }}{{ end }}{{ if eq .Env.Posh_PSDebug "Stop" }} {{ end }}{{ if eq .Env.Posh_PSDebug "SilentlyContinue" }}{{ end }}{{ if eq .Env.Posh_PSDebug "Suspend" }}⏾{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template: {{ .Env.Posh_PSVersion }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ if eq .Env.Posh_PSError "Break" }}{{ end }}{{ if eq .Env.Posh_PSError "Continue" }}{{ end }}{{ if eq .Env.Posh_PSError "Ignore" }} {{ end }}{{ if eq .Env.Posh_PSError "Inquire" }}{{ end }}{{ if eq .Env.Posh_PSError "Stop" }} {{ end }}{{ if eq .Env.Posh_PSError "SilentlyContinue" }}{{ end }}{{ if eq .Env.Posh_PSError "Suspend" }}⏾{{ end }}{{ if eq .Env.Posh_PSError "CategoryView" }}{{ end }}{{ if eq .Env.Posh_PSError "NormalView" }}{{ end }}{{ if eq .Env.Posh_PSError "DetailedView" }}{{ end }}
[DEBUG] 10:40:41.450 text.go:Render:70 → Rendering template:  {{ .Name }}
[TRACE] 10:40:41.451 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.451 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.451 shell.go:Shell() - 0s
[TRACE] 10:40:41.451 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.451 shell.go:Shell() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:Shell() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:Shell() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.452 shell.go:Shell() - 0s
[TRACE] 10:40:41.452 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[DEBUG] 10:40:41.453 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.453 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: powerline
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.453 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[DEBUG] 10:40:41.453 properties.go:GetString:28 → {{ .Code }}
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.453 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Exit
[TRACE] 10:40:41.453 shell.go:StatusCodes() - 0s
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: {{ .Code }}
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.453 shell.go:GOOS() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Executiontime
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.453 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.453 properties.go:GetBool:22 → always_enabled: false
[TRACE] 10:40:41.453 shell.go:ExecutionTime() - 0s
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.453 properties.go:GetFloat64:34 → threshold: 1.000000
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.453 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template:  {{ .Env.Posh_PID }}  ﬓ
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template:  {{ .Env.Posh_HistoryId }}
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template:  {{ .Env.Posh_WS }}
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 text.go:Render:70 → Rendering template: diamond
[DEBUG] 10:40:41.453 shell_windows.go:TerminalWidth:92 → terminal width: 123
[TRACE] 10:40:41.453 shell_windows.go:TerminalWidth() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:Shell() - 0s
[TRACE] 10:40:41.453 shell.go:Flags() - 0s
[TRACE] 10:40:41.453 shell.go:Pwd() - 0s
[DEBUG] 10:40:41.453 shell_windows.go:56 → C:\Users\Elevated
[TRACE] 10:40:41.453 shell.go:GOOS() - 0s
[DEBUG] 10:40:41.453 segment.go:SetEnabled:494 → Segment: Text
[TRACE] 10:40:41.453 shell.go:TemplateCache() - 0s
[DEBUG] 10:40:41.453 text.go:Render:70 ↓
    Rendering template:
    {{ repeat (.Env.Posh_PSNestedPromptLevel | int) "" }}
[TRACE] 10:40:41.454 shell.go:TemplateCache() - 0s
[TRACE] 10:40:41.454 shell.go:Shell() - 0s
[DEBUG] 10:40:41.454 shell.go:Getenv:392 → NO DATA
[TRACE] 10:40:41.454 shell.go:Getenv(TERM_PROGRAM) - 67.4µs
[DEBUG] 10:40:41.454 text.go:Render:70 → Rendering template: diamond
[TRACE] 10:40:41.454 shell.go:Shell() - 0s
[TRACE] 10:40:41.454 shell.go:Shell() - 0s
[TRACE] 10:40:41.454 shell.go:Shell() - 0s
[DEBUG] 10:40:41.454 shell.go:Getenv:392 → C:\Users\Elevated\AppData\Local
[TRACE] 10:40:41.454 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 10:40:41.454 shell_windows.go:CachePath() - 0s
[TRACE] 10:40:41.454 shell.go:Flags() - 0s
JanDeDobbeleer commented 1 year ago

@magma-chili I'll have a look at why we're (seemingly) counting the length incorrectly. Because that's what we do, and then fill remaining space with spaces since that version.

Bo-Fone commented 1 year ago

Is this related to the issue I reported a few days ago?

JanDeDobbeleer commented 1 year ago

@magma-chili so, you can't use raw hyperlink ANSI in a template as we can't count the prompt length correctly in that case. You can however make use of our built-in function to create such links using {{ path .Text .Location }} so we can correctly count the actual characters. Stripping ANSI is almost impossible without writing an interpreter for the sake of counting strings so you can't add that from a segment's template. Please rewrite the template function so it uses our link builder and you'll be fine.

magma-chili commented 1 year ago

@magma-chili so, you can't use raw hyperlink ANSI in a template as we can't count the prompt length correctly in that case. You can however make use of our built-in function to create such links using {{ path .Text .Location }} so we can correctly count the actual characters. Stripping ANSI is almost impossible without writing an interpreter for the sake of counting strings so you can't add that from a segment's template. Please rewrite the template function so it uses our link builder and you'll be fine.

Thanks that built-in function works nicely.

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