JanDeDobbeleer / oh-my-posh

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

Transient prompt windows powershell shows first character of command on filler row #5601

Closed ukdocCT closed 2 months ago

ukdocCT commented 2 months ago

Code of Conduct

What happened?

I recently implemented transient prompt for use in my powershell oh-my-plus config. I added the following block: "transient_prompt": { "background": "transparent", "foreground": "#FEF5ED", "template": "\ue285 ", "filler": "~", "newline": true }, However, when i run a command it shows the first character of the command as the last character of my filler row: image

It does this for powershell 5 and 7 inside and outside terminal.

Theme

Custom theme:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "#d3d7cf",
          "foreground": "#000000",
          "leading_diamond": "\u256d\u2500\ue0b2",
          "style": "diamond",
          "template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
          "type": "os"
        },
        {
          "background": "#3465a4",
          "foreground": "#e4e4e4",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "home_icon": "~",
            "style": "full"
          },
          "style": "powerline",
          "template": " \uf07c {{ .Path }} ",
          "type": "path"
        },
        {
          "background": "#4e9a06",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#c4a000{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}",
            "{{ if gt .Ahead 0 }}#89d1dc{{ end }}",
            "{{ if gt .Behind 0 }}#4e9a06{{ end }}"
          ],
          "foreground": "#000000",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": "\uf126 ",
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true
          },
          "style": "powerline",
          "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 }} ",
          "type": "git"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [
        {
          "background": "#FEAC19",
          "foreground": "#ffffff",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "properties": {
            "display_mode": "files",
            "fetch_version": false
          },
          "style": "powerline",
          "template": " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} \uf0e7",
          "type": "azfunc"
        },
        {
          "background_templates": [
            "{{if contains \"default\" .Profile}}#FFA400{{end}}",
            "{{if contains \"jan\" .Profile}}#f1184c{{end}}"
          ],
          "foreground": "#ffffff",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "properties": {
            "display_default": false
          },
          "style": "powerline",
          "template": " {{ .Profile }}{{ if .Region }}@{{ .Region }}{{ end }} \ue7ad ",
          "type": "aws"
        },
        {
          "background": "#ffff66",
          "foreground": "#111111",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "style": "powerline",
          "template": " \uf0ad ",
          "type": "root"
        },
        {
          "background": "#c4a000",
          "foreground": "#000000",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "style": "powerline",
          "template": " {{ .FormattedMs }} \uf252 ",
          "type": "executiontime"
        },
        {
          "background": "#000000",
          "background_templates": [
            "{{ if gt .Code 0 }}#cc2222{{ end }}"
          ],
          "foreground": "#d3d7cf",
          "invert_powerline": true,
          "powerline_symbol": "\ue0b2",
          "properties": {
            "always_enabled": true
          },
          "style": "powerline",
          "template": " {{ if gt .Code 0 }}{{ .Meaning }}{{ else }}\u2714{{ end }} ",
          "type": "exit"
        },
        {
          "background": "#d3d7cf",
          "foreground": "#000000",
          "invert_powerline": true,
          "style": "diamond",
          "template": " {{ .CurrentDate | date .Format }} \uf017 ",
          "properties": {
            "time_format": "02 Jan 15:04:05"
          },
          "trailing_diamond": "\ue0b0\u2500\u256e",
          "type": "time"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#d3d7cf",
          "style": "plain",
          "template": "\u2570\u2500\u27eb",
          "type": "text"
        }
      ],
      "type": "prompt"
    },
    {
      "segments": [
        {
          "foreground": "#d3d7cf",
          "style": "plain",
          "template": "\u2500\u256f",
          "type": "text"
        }
      ],
      "type": "rprompt"
    }
  ],
  "transient_prompt": {
    "background": "transparent",
    "foreground": "#FEF5ED",
    "template": "\ue285 ",
    "filler": "~",
    "newline": true
  },
  "final_space": true,
  "version": 2
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~oh-my-posh.exe debug powershell --plain

Version: 23.12.0

Shell: powershell (5.1.19041.4780)

Prompt:

╭─    C:\docs                                                                                                       ✔  11 Sep 15:15:09  ─╮
╰─⟫                                                                                                                                              ─╯

Segments:

ConsoleTitle(false)                       -   0 ms
Os(true)                                  -   2 ms
Path(true)                                -   3 ms
Exit(true)                                -   1 ms
Time(true)                                -   0 ms
Text(true)                                -   0 ms
Text(true)                                -   0 ms

Run duration: 29.4396ms

Cache path: C:\Users\dave.richards\AppData\Local\oh-my-posh

Config path: C:\docs\tools\POSHThemes\DavesTheme.omp.json

Logs:

[DEBUG] 15:15:09.657 debug.go:42 → debug mode enabled
[DEBUG] 15:15:09.657 debug.go:42 → plain mode enabled
[DEBUG] 15:15:09.657 terminal.go:Getenv:165 → C:\Users\dave.richards\AppData\Local
[TRACE] 15:15:09.657 terminal.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 15:15:09.658 terminal.go:CachePath() - 526.8µs
[DEBUG] 15:15:09.658 terminal.go:70 → loading cache file: C:\Users\dave.richards\AppData\Local\oh-my-posh\omp.cache
[DEBUG] 15:15:09.658 terminal.go:70 → loading cache key: upgrade_check
[TRACE] 15:15:09.658 terminal.go(C:\Users\dave.richards\AppData\Local\oh-my-posh\omp.cache) - 0s
[DEBUG] 15:15:09.658 terminal.go:Getenv:165 → C:\Users\dave.richards\AppData\Local
[TRACE] 15:15:09.658 terminal.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 15:15:09.658 terminal.go:CachePath() - 0s
[DEBUG] 15:15:09.658 terminal.go:70 → loading cache file: C:\Users\dave.richards\AppData\Local\oh-my-posh\omp.cache.31544
[DEBUG] 15:15:09.658 terminal.go:70 → loading cache key: prompt_count_cache
[DEBUG] 15:15:09.658 terminal.go:70 → loading cache key: template_cache
[TRACE] 15:15:09.658 terminal.go(C:\Users\dave.richards\AppData\Local\oh-my-posh\omp.cache.31544) - 525.8µs
[DEBUG] 15:15:09.658 terminal.go:Getenv:165 → C:\docs\tools\POSHThemes\DavesTheme.omp.json
[TRACE] 15:15:09.658 terminal.go:Getenv(POSH_THEME) - 0s
[DEBUG] 15:15:09.658 terminal.go:ResolveConfigPath:97 → config set using POSH_THEME: C:\docs\tools\POSHThemes\DavesTheme.omp.json
[TRACE] 15:15:09.658 terminal.go:ResolveConfigPath() - 0s
[TRACE] 15:15:09.658 terminal.go:SetPromptCount() - 0s
[TRACE] 15:15:09.658 terminal.go:Init() - 1.5778ms
[TRACE] 15:15:09.658 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 load.go:loadConfig() - 2.1184ms
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.660 debug.go:50 → terminal program: Unknown
[DEBUG] 15:15:09.660 debug.go:50 → terminal shell: shell
[DEBUG] 15:15:09.660 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.660 terminal.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 15:15:09.660 terminal_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.660 terminal_windows.go:WindowsRegistryKeyValue:215 → ColorizationColor(DWORD): 0xC40078D7
[TRACE] 15:15:09.660 terminal.go:Shell() - 0s
[DEBUG] 15:15:09.660 terminal.go:Getenv:165 → 5.1.19041.4780
[TRACE] 15:15:09.660 terminal.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 15:15:09.660 debug.go:PrintDebug:23 → segment: Title
[DEBUG] 15:15:09.660 text.go:Render:80 → rendering template:
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 terminal.go:Shell() - 0s
[DEBUG] 15:15:09.660 terminal.go:Getenv:165 → 1
[TRACE] 15:15:09.660 terminal.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 15:15:09.660 terminal.go:Getenv:165 → 1
[TRACE] 15:15:09.660 terminal.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.660 terminal.go:PathSeparator() - 0s
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[TRACE] 15:15:09.660 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.662 terminal.go:Pwd:190 → C:\docs
[TRACE] 15:15:09.662 terminal.go:Pwd() - 1.627ms
[DEBUG] 15:15:09.662 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.662 segment.go:SetEnabled:115 → segment: Git
[TRACE] 15:15:09.662 terminal.go:Pwd() - 0s
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.662 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.662 terminal.go:Getenv:165 → C:\Users\dave.richards\AppData\Local
[DEBUG] 15:15:09.662 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.662 terminal.go:Getenv(LOCALAPPDATA) - 0s
[DEBUG] 15:15:09.662 segment.go:SetEnabled:115 → segment: Path
[DEBUG] 15:15:09.662 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.662 path.go:149 → display_cygpath: false
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.662 terminal.go:PathSeparator() - 0s
[TRACE] 15:15:09.662 terminal.go:Pwd() - 0s
[TRACE] 15:15:09.662 terminal.go:Shell() - 0s
[TRACE] 15:15:09.662 terminal.go:Shell() - 0s
[TRACE] 15:15:09.662 terminal.go:Flags() - 0s
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.662 segment.go:SetEnabled:115 → segment: Os
[TRACE] 15:15:09.662 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.662 os.go:Enabled:34 → 
[TRACE] 15:15:09.662 terminal_windows.go:Root() - 560.1µs
[DEBUG] 15:15:09.662 path.go:setMappedLocations:563 → mapped_locations_enabled: true
[DEBUG] 15:15:09.663 path.go:setMappedLocations:564 → 
[DEBUG] 15:15:09.663 path.go:setMappedLocations:565 → 
[TRACE] 15:15:09.663 terminal.go:Shell() - 440.3µs
[TRACE] 15:15:09.663 terminal.go:StatusCodes() - 0s
[DEBUG] 15:15:09.663 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.663 terminal_windows.go:IsWsl() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:PathSeparator() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 path.go:setMappedLocations:566 → ~
[DEBUG] 15:15:09.663 path.go:setMappedLocations:571 → mapped_locations: map[]
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:PathSeparator() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 terminal.go:TemplateCache:652 → environment: [=::=::\ ALLUSERSPROFILE=C:\ProgramData APPDATA=C:\Users\dave.richards\AppData\Roaming ChocolateyInstall=C:\ProgramData\chocolatey CommonProgramFiles=C:\Program Files\Common Files CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files CommonProgramW6432=C:\Program Files\Common Files COMPUTERNAME=CT-645 ComSpec=C:\WINDOWS\system32\cmd.exe CONDA_PROMPT_MODIFIER=False DriverData=C:\Windows\System32\Drivers\DriverData HOMEDRIVE=C: HOMEPATH=\Users\dave.richards IGCCSVC_DB=AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAO/pj3mXzSkmgB2gqW1CuTQQAAAACAAAAAAAQZgAAAAEAACAAAACtARFywRINT+ql8cC8bIwWmv5XxXTe7vkPvR5P3ArRswAAAAAOgAAAAAIAACAAAABjH4M5acYs9LoxxvTvZjNjmmwy+L5m8gR6OWrn/qv0XWAAAACPTftZaGfkPr5Qr3Vdeyv3kw+T9e21UlJteasRc/3I+8KyW0LDHMEOOcUr6cvHdsSb855W4DEHP1+QhGfVjBaif6kDXMiDmaiTk79H94bzG2NaraiQ6popURm2C51Bcx5AAAAAWvKMroTlZEjqzBnDwpe/ouA8GwyPWiy6FXI+uimm08lxjNXExy/VEG9Kh1Sw9KkFJdiGt8jYTY7MQUtDgADL7A== LOCALAPPDATA=C:\Users\dave.richards\AppData\Local LOGONSERVER=\\PVAZUUKSDC01 NUMBER_OF_PROCESSORS=20 OneDrive=C:\Users\dave.richards\OneDrive - Castle Trust Capital Management Limited OneDriveCommercial=C:\Users\dave.richards\OneDrive - Castle Trust Capital Management Limited OPENSSL_CONF=c:\Docs\tools2\OpenSSL\openssl.cnf OS=Windows_NT Path=C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;c:\docs\tools;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;c:\docs\tools;c:\docs\tools\Batch;c:\docs\tools\VBScript;c:\docs\tools\Powershell;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft VS Code\bin;C:\Program Files\dotnet\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\WinMerge;C:\Program Files\Azure Data Studio\bin;c:\docs\tools\sysinternals;c:\docs\tools2\openssl;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft Group Policy\Windows 10 May 2021 Update (21H1)\PolicyDefinitions\;C:\Program Files\PowerShell\Scripts;C:\Program Files (x86)\Microsoft SQL Server\160\DTS\Binn\;C:\Program Files\Amazon\AWSCLIV2\;C:\Program Files\TortoiseGit\bin;C:\Program Files\Git\cmd;C:\Program Files\PowerShell\7\;C:\Users\dave.richards\scoop\shims;C:\Users\dave.richards\AppData\Local\Microsoft\WindowsApps;;C:\Program Files\Azure Data Studio\bin;C:\Program Files (x86)\Nmap;C:\Users\dave.richards\AppData\Local\Programs\Fiddler;C:\Users\dave.richards\.dotnet\tools;c:\Docs\tools2\OpenSSL PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL POSH_CURSOR_COLUMN=1 POSH_CURSOR_LINE=1 POSH_PID=31544 POSH_SHELL_VERSION=5.1.19041.4780 POSH_THEME=C:\docs\tools\POSHThemes\DavesTheme.omp.json POSH_THEMES_PATH=c:\docs\tools\POSHThemes POWERLINE_COMMAND=oh-my-posh POWERSHELL_DISTRIBUTION_CHANNEL=MSI:Windows 10 Enterprise PROCESSOR_ARCHITECTURE=AMD64 PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 186 Stepping 2, GenuineIntel PROCESSOR_LEVEL=6 PROCESSOR_REVISION=ba02 ProgramData=C:\ProgramData ProgramFiles=C:\Program Files ProgramFiles(x86)=C:\Program Files (x86) ProgramW6432=C:\Program Files PSModulePath=C:\Users\dave.richards\OneDrive - Castle Trust Capital Management Limited\Documents\WindowsPowerShell\Modules;C:\Program Files\PowerShell\Modules;C:\Program Files (x86)\WindowsPowerShell\Modules;C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;C:\Program Files\SharePoint Online Management Shell\;C:\Program Files (x86)\Microsoft Azure Information Protection\Powershell;C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin PUBLIC=C:\Users\Public SESSIONNAME=Console SMS_ADMIN_UI_PATH=C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin\i386 SystemDrive=C: SystemRoot=C:\WINDOWS TEMP=C:\Users\DAVE~1.RIC\AppData\Local\Temp TMP=C:\Users\DAVE~1.RIC\AppData\Local\Temp USERDNSDOMAIN=CASTLETRUST.CO.UK USERDOMAIN=CASTLETRUST USERDOMAIN_ROAMINGPROFILE=CASTLETRUST USERNAME=dave.richards USERPROFILE=C:\Users\dave.richards windir=C:\WINDOWS WIX=C:\Program Files (x86)\WiX Toolset v3.11\ ZES_ENABLE_SYSMAN=1 _NT_SYMBOL_PATH=srv*c:\MSSymbols*https://msdl.microsoft.com/download/symbols __PSLockDownPolicy=0]
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.663 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.663 terminal_windows.go:IsWsl() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 path.go:makeFolderFormatMap:839 → NO DATA
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 path.go:setStyle:218 → full
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 path.go:colorizePath:740 → cycle: []
[DEBUG] 15:15:09.663 terminal.go:User:331 → dave.richards
[DEBUG] 15:15:09.663 path.go:getFolderSeparator:273 → NO DATA
[TRACE] 15:15:09.663 terminal.go:User() - 0s
[DEBUG] 15:15:09.663 path.go:getFolderSeparator:275 → \
[DEBUG] 15:15:09.663 path.go:colorizePath:743 → cycle_folder_separator: false
[DEBUG] 15:15:09.663 path.go:colorizePath:744 → %s
[DEBUG] 15:15:09.663 path.go:colorizePath:746 → %s
[DEBUG] 15:15:09.663 path.go:colorizePath:747 → %s
[DEBUG] 15:15:09.663 path.go:colorizePath:748 → %s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.663 terminal.go:Host:348 → CT-645
[TRACE] 15:15:09.663 terminal.go:Host() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.663 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.663 terminal.go:Getenv(SHLVL) - 0s
[TRACE] 15:15:09.663 terminal.go:TemplateCache() - 1.0004ms
[TRACE] 15:15:09.663 terminal.go:TemplateCache() - 0s
[TRACE] 15:15:09.663 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.663 terminal.go:StackCount() - 0s
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-545
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:311 ↓
    SYNCHRONIZE
    READ_CONTROL
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:303 → current user is member of S-1-5-11
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:311 ↓
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:303 → current user is member of S-1-5-11
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:311 ↓
    GENERIC_READ
    GENERIC_WRITE
    GENERIC_EXECUTE
    DELETE
[DEBUG] 15:15:09.664 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 15:15:09.664 terminal_windows.go:DirIsWritable() - 998.1µs
[TRACE] 15:15:09.664 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.682 terminal.go:CommandPath:390 → C:\Program Files\Git\cmd\git.exe
[TRACE] 15:15:09.682 terminal.go:CommandPath(git.exe) - 20.1165ms
[TRACE] 15:15:09.682 terminal.go:HasCommand(git.exe) - 20.1165ms
[DEBUG] 15:15:09.682 git.go:shouldDisplay:312 → fetch_bare_info: false
[TRACE] 15:15:09.682 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.682 terminal.go:ResolveSymlink:287 → C:\Docs
[TRACE] 15:15:09.682 terminal.go:ResolveSymlink(C:\docs) - 0s
[ERROR] 15:15:09.682 terminal.go:HasParentFilePath:554 → CreateFile .git: The system cannot find the file specified.
[TRACE] 15:15:09.682 terminal.go:HasParentFilePath(.git) - 0s
[DEBUG] 15:15:09.682 text.go:Render:80 → rendering template:   {{ .Path }}
[TRACE] 15:15:09.682 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.682 text.go:Render:80 → rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[TRACE] 15:15:09.682 terminal.go:Flags() - 0s
[TRACE] 15:15:09.683 terminal.go:TemplateCache() - 0s
[TRACE] 15:15:09.683 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.683 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.683 text.go:Render:80 → rendering template: diamond
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.683 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[TRACE] 15:15:09.683 terminal.go:Shell() - 0s
[TRACE] 15:15:09.683 terminal.go:Shell() - 0s
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[TRACE] 15:15:09.683 terminal.go:Pwd() - 0s
[TRACE] 15:15:09.683 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Time
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Azfunc
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.683 time.go:Enabled:29 → 02 Jan 15:04:05
[TRACE] 15:15:09.683 terminal.go:TemplateCache() - 0s
[TRACE] 15:15:09.683 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.683 language.go:Enabled:109 → extensions: [host.json local.settings.json function.json]
[DEBUG] 15:15:09.683 language.go:Enabled:110 → folders: []
[TRACE] 15:15:09.683 terminal.go:Pwd() - 0s
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Aws
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Root
[DEBUG] 15:15:09.683 status.go:Init:53 → {{ .Code }}
[DEBUG] 15:15:09.683 aws.go:Enabled:42 → display_default: false
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Executiontime
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.683 terminal.go:Pwd() - 0s
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_VAULT) - 0s
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_DEFAULT_PROFILE) - 0s
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.683 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.683 executiontime.go:Enabled:57 → always_enabled: false
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_PROFILE) - 0s
[DEBUG] 15:15:09.683 segment.go:SetEnabled:115 → segment: Exit
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.683 terminal.go:ExecutionTime() - 0s
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_REGION) - 0s
[TRACE] 15:15:09.683 terminal.go:StatusCodes() - 0s
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[DEBUG] 15:15:09.683 text.go:Render:80 → rendering template: {{ .Code }}
[DEBUG] 15:15:09.683 executiontime.go:Enabled:59 → threshold: 500.000000
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_DEFAULT_REGION) - 0s
[DEBUG] 15:15:09.683 terminal.go:Getenv:165 → NO DATA
[TRACE] 15:15:09.683 terminal.go:Getenv(AWS_CONFIG_FILE) - 0s
[DEBUG] 15:15:09.683 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.683 terminal_windows.go:Root() - 0s
[DEBUG] 15:15:09.683 terminal.go:FileContent:302 ↓
    [default]
    region = eu-west-1
    output = text

    s3 =
        max_concurrent_requests = 20
        max_queue_size = 10000

[TRACE] 15:15:09.683 terminal.go:FileContent(C:\Users\dave.richards/.aws/config) - 0s
[DEBUG] 15:15:09.684 terminal.go:HasFilesInDir:243 → false
[TRACE] 15:15:09.684 terminal.go:HasFilesInDir(host.json) - 1.0016ms
[TRACE] 15:15:09.684 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.684 terminal.go:HasFilesInDir:243 → false
[TRACE] 15:15:09.684 terminal.go:HasFilesInDir(local.settings.json) - 0s
[TRACE] 15:15:09.684 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.684 terminal.go:HasFilesInDir:243 → false
[TRACE] 15:15:09.684 terminal.go:HasFilesInDir(function.json) - 0s
[TRACE] 15:15:09.684 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.684 status.go:Enabled:42 → always_enabled: true
[TRACE] 15:15:09.684 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.684 text.go:Render:80 → rendering template:  {{ .CurrentDate | date .Format }} 
[TRACE] 15:15:09.684 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.684 text.go:Render:80 → rendering template:  {{ if gt .Code 0 }}{{ .Meaning }}{{ else }}✔{{ end }}
[TRACE] 15:15:09.684 terminal.go:Flags() - 0s
[TRACE] 15:15:09.684 terminal.go:TemplateCache() - 0s
[TRACE] 15:15:09.684 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: {{ if gt .Code 0 }}#cc2222{{ end }}
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[TRACE] 15:15:09.685 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: powerline
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: {{ if gt .Code 0 }}#cc2222{{ end }}
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[TRACE] 15:15:09.685 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: diamond
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: {{ if gt .Code 0 }}#cc2222{{ end }}
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[TRACE] 15:15:09.685 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.685 terminal_windows.go:TerminalWidth:116 → terminal width: 147
[TRACE] 15:15:09.685 terminal_windows.go:TerminalWidth() - 0s
[TRACE] 15:15:09.685 terminal.go:Shell() - 0s
[TRACE] 15:15:09.685 terminal.go:Shell() - 0s
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[TRACE] 15:15:09.685 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.685 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.685 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.685 segment.go:SetEnabled:115 → segment: Text
[TRACE] 15:15:09.685 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.685 text.go:Render:80 → rendering template: ╰─⟫
[TRACE] 15:15:09.685 terminal.go:Flags() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[DEBUG] 15:15:09.686 text.go:Render:80 → rendering template: plain
[TRACE] 15:15:09.686 terminal.go:Flags() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[TRACE] 15:15:09.686 terminal.go:Flags() - 0s
[TRACE] 15:15:09.686 terminal.go:Pwd() - 0s
[DEBUG] 15:15:09.686 terminal_windows.go:58 → C:\Users\dave.richards
[TRACE] 15:15:09.686 terminal.go:GOOS() - 0s
[DEBUG] 15:15:09.686 segment.go:SetEnabled:115 → segment: Text
[TRACE] 15:15:09.686 terminal.go:TemplateCache() - 0s
[DEBUG] 15:15:09.686 text.go:Render:80 → rendering template: ─╯
[TRACE] 15:15:09.686 terminal.go:Flags() - 0s
[DEBUG] 15:15:09.686 text.go:Render:80 → rendering template: plain
[TRACE] 15:15:09.686 terminal.go:Flags() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[TRACE] 15:15:09.686 terminal.go:Shell() - 0s
[DEBUG] 15:15:09.686 terminal_windows.go:TerminalWidth:99 → terminal width: 147
[TRACE] 15:15:09.686 terminal_windows.go:TerminalWidth() - 0s
[DEBUG] 15:15:09.686 terminal.go:Getenv:165 → C:\Users\dave.richards\AppData\Local
[TRACE] 15:15:09.686 terminal.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 15:15:09.686 terminal.go:CachePath() - 0s
[TRACE] 15:15:09.686 terminal.go:Flags() - 0s
ClxUne09 commented 2 months ago

Could you provide the JSON theme in a code block? It's hard to read. Also, could you provide a larger image of the terminal?

lewis-yeung commented 2 months ago

I can reproduce this.

JanDeDobbeleer commented 2 months ago

@lewis-yeung same but I haven't found the culprit just yet.

lewis-yeung commented 2 months ago

~@JanDeDobbeleer It's caused by the terminal width being reduced by 1 for patching the PowerShell bleed bug.~

JanDeDobbeleer commented 2 months ago

@lewis-yeung probably I'm an idiot, but even removing that doesn't solve it as the patching isn't enabled here yet the bug remains.

lewis-yeung commented 2 months ago

This can be interesting and somewhat weird. After testing and debugging, I think the root cause lies in how PowerShell/PSReadLine handles the case when the prompt line reaches the rightmost cell on the terminal screen. Moreover, the behavior is inconsistent in different terminal programs.

I did tests on Windows and WSL 2, in VS Code terminal and Windows Terminal, with patch_pwsh_bleed set to false. All transient prompts are spawned by pressing the Enter key with empty input buffer in PowerShell v7.4.5 and PSReadLine v2.4.0.

Only on WSL 2 and in VS Code terminal can a transient prompt line fill up to the rightmost cell:

screenshot-1

For other three combinations, it can only reach the cell previous to the rightmost one:

screenshot-2

The key is, the cursor refuses to move forward to the line end even though a printed prompt line reaches the rightmost cell (i.e., it stays before the rightmost cell), thus a subsequent character will overwrite the existing one in the rightmost cell. This results in the bug that we see: the next character which is the first one of the command, seized the rightmost cell.

UPDATED: More info from my further tests:

JanDeDobbeleer commented 2 months ago

@lewis-yeung OK, so I'm not an idiot after all. I had the same analysis after debugging over lunch.

You can also see, when you do TerminalWidth++, it has 1 character on the next line. So oh-my-posh is calculating the width correctly, it's after printing that PSReadLine swallows the last character.

We'll have to create a bug on their end as I didn't find a way to patch this. It's either too short, or too long.

JanDeDobbeleer commented 2 months ago

@lewis-yeung on the update, the logic is always identical as to how we position a right aligned block. So any differences theoretically originate from the shell itself.

snoweuph commented 1 month ago

The filler for the transient prompt does not work at all in Zsh.

I noticed that, and that theres no Info about this in the doc, is this an unpatched bug? @lewis-yeung

lewis-yeung commented 1 month ago

is this an unpatched bug?

@snoweuph It should be, but I haven't found the root cause.

snoweuph commented 1 month ago

Dann :(

JanDeDobbeleer commented 1 month ago

@lewis-yeung I investigated this as well, didn't understand what is causing this as oh-my-posh does print it if I remember correctly.