Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-aligned prompts are not right-aligned in Bash/mintty on Windows #5090

Closed
1 task done
Bilge opened this issue Jun 15, 2024 · 25 comments · Fixed by #5091 or #5094
Closed
1 task done

Right-aligned prompts are not right-aligned in Bash/mintty on Windows #5090

Bilge opened this issue Jun 15, 2024 · 25 comments · Fixed by #5091 or #5094
Assignees
Labels
🐛 bug Something isn't working

Comments

@Bilge
Copy link

Bilge commented Jun 15, 2024

Code of Conduct

  • I agree to follow this project's Code of Conduct

What happened?

The right-aligned portions of the prompt are never right-aligned; they sit somewhere in the middle of the screen. Moreover, they keep changing their alignment depending on the width of the left-aligned segments, which is weird.

image

In case you are supposing this is a limitation with Bash/mintty, the same feature works fine in Starship.

Theme

powerlevel10k_rainbow

What OS are you seeing the problem on?

Windows

Which shell are you using?

bash

Log output

[DEBUG] 12:56:06.103 shell.go:Getenv:326 → mintty
[TRACE] 12:56:06.103 shell.go:Getenv(TERM_PROGRAM) - 519.2µs
[DEBUG] 12:56:06.103 shell.go:Getenv:326 → C:\Users\Bilge\AppData\Local
[TRACE] 12:56:06.103 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 12:56:06.103 shell_windows.go:CachePath() - 0s
[DEBUG] 12:56:06.103 shell.go:Getenv:326 → C:/Users/Bilge/.p10k.omp.yaml
[TRACE] 12:56:06.103 shell.go:Getenv(POSH_THEME) - 0s
[DEBUG] 12:56:06.103 shell.go:Shell:601 → no shell name provided in flags, trying to detect it
[DEBUG] 12:56:06.109 shell.go:Shell:609 → process name: bash.exe
[TRACE] 12:56:06.109 shell.go:Shell() - 5.667ms
[DEBUG] 12:56:06.109 shell.go:resolveConfigPath:260 → Cygwin detected, using full path for config
[TRACE] 12:56:06.109 shell.go:resolveConfigPath() - 5.667ms
[TRACE] 12:56:06.109 shell.go:Init() - 6.1862ms
[TRACE] 12:56:06.109 shell.go:Flags() - 0s
[TRACE] 12:56:06.112 config.go:loadConfig() - 2.6119ms
[TRACE] 12:56:06.112 shell.go:Flags() - 0s
[DEBUG] 12:56:06.112 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.112 shell.go:Getenv(OMP_CACHE_DISABLED) - 0s
[TRACE] 12:56:06.112 shell_windows.go:WindowsRegistryKeyValue(HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM\ColorizationColor) - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.112 shell_windows.go:WindowsRegistryKeyValue:217 → ColorizationColor(DWORD): 0xC40078D7
[TRACE] 12:56:06.112 shell.go:Shell() - 0s
[DEBUG] 12:56:06.112 shell.go:Getenv:326 → 5.2.26(1)-release
[TRACE] 12:56:06.112 shell.go:Getenv(POSH_SHELL_VERSION) - 0s
[DEBUG] 12:56:06.112 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 12:56:06.112 text.go:Render:72 → Rendering template: {{ .Shell }} in {{ .Folder }}
[TRACE] 12:56:06.112 shell_windows.go:Root() - 0s
[TRACE] 12:56:06.112 shell.go:Shell() - 0s
[TRACE] 12:56:06.112 shell.go:StatusCodes() - 0s
[TRACE] 12:56:06.112 shell_windows.go:IsWsl() - 0s
[DEBUG] 12:56:06.112 shell.go:TemplateCache:782 ↓
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.112 shell.go:Pwd:356 → C:\Users\Bilge\Documents\Adobe
[TRACE] 12:56:06.112 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.112 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell_windows.go:IsWsl() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.112 shell.go:User:494 → Bilge
[TRACE] 12:56:06.112 shell.go:User() - 0s
[DEBUG] 12:56:06.112 shell.go:Host:511 → Fractal
[TRACE] 12:56:06.112 shell.go:Host() - 0s
[TRACE] 12:56:06.112 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.112 shell.go:Getenv:326 → 1
[TRACE] 12:56:06.112 shell.go:Getenv(SHLVL) - 0s
[TRACE] 12:56:06.112 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.112 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.112 shell.go:Getenv(POSH_CURSOR_LINE) - 0s
[DEBUG] 12:56:06.112 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.112 shell.go:Getenv(POSH_CURSOR_COLUMN) - 0s
[TRACE] 12:56:06.112 shell.go:Flags() - 0s
[TRACE] 12:56:06.113 shell.go:Flags() - 0s
[TRACE] 12:56:06.113 shell.go:Shell() - 0s
[TRACE] 12:56:06.113 shell.go:Shell() - 0s
[TRACE] 12:56:06.113 shell.go:Flags() - 0s
[TRACE] 12:56:06.113 shell.go:Flags() - 0s
[TRACE] 12:56:06.113 shell.go:Flags() - 0s
[TRACE] 12:56:06.113 shell.go:Pwd() - 0s
[TRACE] 12:56:06.113 shell.go:Pwd() - 0s
[TRACE] 12:56:06.113 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.113 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.113 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.113 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.113 segment.go:SetEnabled:539 → Segment: Os
[DEBUG] 12:56:06.113 segment.go:SetEnabled:539 → Segment: Path
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:Pwd() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:Shell() - 0s
[TRACE] 12:56:06.113 shell.go:Shell() - 0s
[DEBUG] 12:56:06.113 shell.go:Getenv:326 → C:\Users\Bilge\AppData\Local
[TRACE] 12:56:06.113 shell.go:Getenv(LOCALAPPDATA) - 0s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → 
[TRACE] 12:56:06.113 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.113 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 12:56:06.113 properties.go:GetString:28 → 
[DEBUG] 12:56:06.113 properties.go:GetString:28 → 
[DEBUG] 12:56:06.113 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → <nil>
[DEBUG] 12:56:06.113 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → NO DATA
[TRACE] 12:56:06.113 shell.go:GOOS() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → full
[DEBUG] 12:56:06.113 properties.go:GetStringArray:52 → cycle: []
[DEBUG] 12:56:06.113 properties.go:GetString:28 → NO DATA
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → \
[DEBUG] 12:56:06.113 properties.go:GetBool:22 → cycle_folder_separator: false
[DEBUG] 12:56:06.113 properties.go:GetString:28 → %s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → %s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → %s
[DEBUG] 12:56:06.113 properties.go:GetString:28 → %s
[TRACE] 12:56:06.113 shell.go:PathSeparator() - 0s
[TRACE] 12:56:06.113 shell.go:Pwd() - 0s
[TRACE] 12:56:06.113 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.113 shell.go:StackCount() - 0s
[DEBUG] 12:56:06.113 win32_windows.go:isWriteable:299 → not current user or in group
[DEBUG] 12:56:06.113 win32_windows.go:isWriteable:303 → current user is member of S-1-5-32-544
[DEBUG] 12:56:06.113 win32_windows.go:isWriteable:311 ↓
    WRITE_DAC
    WRITE_OWNER
    SYNCHRONIZE
    DELETE
    READ_CONTROL
[DEBUG] 12:56:06.113 win32_windows.go:isWriteable:313 → user has write access
[TRACE] 12:56:06.113 shell_windows.go:DirIsWritable() - 520µs
[TRACE] 12:56:06.113 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.115 shell.go:CommandPath:553 → C:\Program Files\Git\mingw64\bin\git.exe
[TRACE] 12:56:06.115 shell.go:CommandPath(git.exe) - 2.5081ms
[TRACE] 12:56:06.115 shell.go:HasCommand(git.exe) - 2.5081ms
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[ERROR] 12:56:06.115 shell.go:HasParentFilePath:697 → CreateFile .git: The system cannot find the file specified.
[TRACE] 12:56:06.115 shell.go:HasParentFilePath(.git) - 0s
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → fetch_bare_info: false
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template:   {{ .Path }}
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template:  {{ if .WSL }}WSL at {{ end }}{{.Icon}}
[TRACE] 12:56:06.115 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.115 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template: diamond
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template: powerline
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[TRACE] 12:56:06.115 shell.go:Shell() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Time
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Go
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 properties.go:GetString:28 → files
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → extensions: [*.go go.mod]
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → folders: []
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → home_enabled: false
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Aws
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetString:28 → files
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → display_default: false
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_VAULT) - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Python
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_DEFAULT_PROFILE) - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → extensions: [*.py *.ipynb pyproject.toml venv.bak]
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → folders: [.venv venv virtualenv venv-win pyenv-win]
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_PROFILE) - 0s
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_REGION) - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_DEFAULT_REGION) - 0s
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → fetch_virtual_env: false
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.115 shell.go:Getenv:326 → NO DATA
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 properties.go:GetString:28 → 15:04:05
[TRACE] 12:56:06.115 shell.go:Getenv(AWS_CONFIG_FILE) - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.115 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Executiontime
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Julia
[TRACE] 12:56:06.115 shell.go:ExecutionTime() - 0s
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → extensions: [*.jl]
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 properties.go:GetFloat64:34 → threshold: 500.000000
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → folders: []
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(*.go) - 0s
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → home_enabled: false
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(go.mod) - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetString:28 → files
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Flags() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Root
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(*.jl) - 0s
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Ruby
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → extensions: [*.rb Rakefile Gemfile]
[DEBUG] 12:56:06.115 properties.go:GetString:28 → {{ .Code }}
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → folders: []
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Azfunc
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → home_enabled: false
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 properties.go:GetStringArray:52 → folders: []
[DEBUG] 12:56:06.115 properties.go:GetString:28 → files
[DEBUG] 12:56:06.115 properties.go:GetBool:22 → home_enabled: false
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.115 shell_windows.go:58 → C:\Users\Bilge
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 properties.go:GetString:28 → files
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(*.rb) - 0s
[DEBUG] 12:56:06.115 segment.go:SetEnabled:539 → Segment: Status
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.115 shell.go:StatusCodes() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 text.go:Render:72 → Rendering template: {{ .Code }}
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(Rakefile) - 0s
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(host.json) - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.115 shell_windows.go:Root() - 0s
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(Gemfile) - 0s
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(local.settings.json) - 0s
[TRACE] 12:56:06.115 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.115 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.115 shell.go:HasFilesInDir(function.json) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.116 shell.go:HasFilesInDir(*.py) - 1.0003ms
[DEBUG] 12:56:06.115 shell.go:FileContent:468 ↓
    [default]
    region = eu-west-3

[TRACE] 12:56:06.116 shell.go:FileContent(C:\Users\Bilge/.aws/config) - 1.0003ms
[TRACE] 12:56:06.116 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.116 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.116 shell.go:HasFilesInDir(*.ipynb) - 0s
[TRACE] 12:56:06.116 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.116 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.116 shell.go:HasFilesInDir(pyproject.toml) - 0s
[TRACE] 12:56:06.116 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.116 shell.go:HasFilesInDir:409 → false
[TRACE] 12:56:06.116 shell.go:HasFilesInDir(venv.bak) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFolder:438 → false
[TRACE] 12:56:06.116 shell.go:HasFolder(.venv) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFolder:438 → false
[TRACE] 12:56:06.116 shell.go:HasFolder(venv) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFolder:438 → false
[TRACE] 12:56:06.116 shell.go:HasFolder(virtualenv) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFolder:438 → false
[TRACE] 12:56:06.116 shell.go:HasFolder(venv-win) - 0s
[DEBUG] 12:56:06.116 shell.go:HasFolder:438 → false
[TRACE] 12:56:06.116 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.116 shell.go:HasFolder(pyenv-win) - 0s
[DEBUG] 12:56:06.116 properties.go:GetBool:22 → always_enabled: true
[TRACE] 12:56:06.116 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template:  {{ if gt .Code 0 }}{{ reason .Code }}{{ else }}{{ end }}
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template:  {{ .CurrentDate | date .Format }} 
[TRACE] 12:56:06.116 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.116 shell.go:TemplateCache() - 0s
[TRACE] 12:56:06.116 shell.go:Shell() - 0s
[TRACE] 12:56:06.116 shell.go:Shell() - 0s
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: {{ if gt .Code 0 }}#cc2222{{ end }}
[TRACE] 12:56:06.116 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: powerline
[DEBUG] 12:56:06.116 text.go:Render:72 → Rendering template: diamond
[DEBUG] 12:56:06.117 shell_windows.go:TerminalWidth:111 → terminal width: 120
[TRACE] 12:56:06.117 shell_windows.go:TerminalWidth() - 999.6µs
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Flags() - 0s
[TRACE] 12:56:06.117 shell.go:Pwd() - 0s
[DEBUG] 12:56:06.117 shell_windows.go:58 → C:\Users\Bilge
[TRACE] 12:56:06.117 shell.go:GOOS() - 0s
[DEBUG] 12:56:06.117 segment.go:SetEnabled:539 → Segment: Text
[TRACE] 12:56:06.117 shell.go:TemplateCache() - 0s
[DEBUG] 12:56:06.117 text.go:Render:72 → Rendering template: ❯
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[DEBUG] 12:56:06.117 shell.go:Getenv:326 → mintty
[TRACE] 12:56:06.117 shell.go:Getenv(TERM_PROGRAM) - 0s
[DEBUG] 12:56:06.117 text.go:Render:72 → Rendering template: plain
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Flags() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[TRACE] 12:56:06.117 shell.go:Shell() - 0s
[DEBUG] 12:56:06.117 shell.go:Getenv:326 → C:\Users\Bilge\AppData\Local
[TRACE] 12:56:06.117 shell.go:Getenv(LOCALAPPDATA) - 0s
[TRACE] 12:56:06.117 shell_windows.go:CachePath() - 0s
[TRACE] 12:56:06.117 shell.go:Flags() - 0s
@Bilge Bilge added the 🐛 bug Something isn't working label Jun 15, 2024
@JanDeDobbeleer
Copy link
Owner

@Bilge weird this has never been reported before. I can try to have a look.

@JanDeDobbeleer
Copy link
Owner

Due to git bash' broken nature it can't interact nicely with the native Windows API and thus reported the incorrect terminal width. Fix incoming.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Thanks for the fast fix 🙂 👍🏻

The default theme is right-aligned; my (slightly modified) version of P10K is not quite aligned to the right-hand edge but that probably just requires some tweaking.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Actually, it's still doing the weird thing where descending into directories is pulling further and further away from the right-hand edge. Only in the home directory is it flush against the right-hand side.

image

@JanDeDobbeleer
Copy link
Owner

I'll have a look, this shouldn't happen although it can be another git bash bug. Does the same happen inside Windows Terminal?

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

It does not happen in PowerShell in Windows Terminal... although it's not really a fair test since I'm not using the Nerd font in Windows Terminal (nor am I using Bash). I tried to get it to run in WSL 1, but it doesn't work because the init script spits out the host path instead of the mounted path in WSL.

@JanDeDobbeleer
Copy link
Owner

@Bilge you can run bash also in Windows Terminal, doesn't need to be PWSH.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Sure, but it keeps messing up the path. Whether under WSL 1 or just cmd.exe, for some reason the path to oh-my-posh.exe is /mnt/c/Program Files (x86)/oh-my-posh/bin/oh-my-posh.exe, but the init script keeps spitting out, C:/Program Files (x86)/oh-my-posh/bin/oh-my-posh.exe, which it cannot find (another bug?).

To be clear, the init script is the same under git Bash, but git Bash is clever in that it automatically remaps references to C:/; other environments cannot do that.

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Jun 15, 2024

@Bilge not a bug. When using WSL, you need to use the linux executable. I meant you can run git bash, which is a Windows runtime faking linux tooling, inside Terminal. WSL is a linux runtime, so it needs to Linux oh-my-posh to work.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

So you claim, and yet WSL 1 can run Windows native binaries, including oh-my-posh just fine. After all, it spits out the init script, it's only the paths that are incorrect. Case in point, oh-my-posh.exe print primary also works in WSL 1. I could probably search/replace the path references and it would work as expected.

Of course, what you are suggesting isn't wrong; I could install it twice, using the native runtime, it's just that I don't want to install it twice 🙂

@JanDeDobbeleer
Copy link
Owner

@Bilge I know it can, and on WSL1 it will be "fast", on 2 slow and it's going to interact with Windows API's whereas the context is actually a linux runtime. It can be solved, but I purposefully don't do that. It's not a good idea.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Anyway, using the print primary command, I can see that there is no such issue under Windows Terminal (with its default font), so it's either a font issue or a git Bash issue.

@JanDeDobbeleer
Copy link
Owner

@Bilge I'm going to have a look, always interesting.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Having installed the LiterationMono Nerd Font in Windows Terminal, it still seems to be printing consistent widths (with consistent right-alignment), so the alignment issue seems to be purely isolated to git Bash. Probably I am the only one trying to use OMP in the git Bash environment, which is why none of these issues have been discovered before 😆

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Jun 15, 2024

@Bilge trust me, there are plenty 😁 But, people do tend to use Windows Terminal with git bash rather than mintty.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Uh... git Bash uses mintty. They are, effectively, one and the same.

@JanDeDobbeleer
Copy link
Owner

@Bilge mintty is the terminal emulator, not the shell. You can run git bash as is inside Windows Terminal.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

Oh, heh. Well I ran the git Bash specific flavour of Bash inside WSL 1 and it actually exhibits the same behaviour. So it is a git Bash issue (probably not a mintty issue).

image

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Jun 15, 2024

@Bilge you can use this configuration to see what bash behaves like in Windows Terminal:

{
    "commandline": "%PROGRAMFILES%/Git/usr/bin/bash.exe -i -l",
    "guid": "{00000000-0000-0000-ba54-000000000002}",
    "icon": "%PROGRAMFILES%/Git/mingw64/share/git/git-for-windows.ico",
    "name": "Bash",
    "startingDirectory": "%USERPROFILE%"
}

Git Bash is actually mintty that runs this bash version inside as a packaged entity.

That said, I don't have the above issue with my theme.

image

I can reproduce this using Git's Bash with powerlevel10k_rainbow.omp.json, but not on native bash. The \ character in the path is what's causing it, but that's escaped. So this is a bug in Git Bash apparently.

image

You can fix it by adjusting the configuration for the path segment to use a forward slash as path separator "folder_separator_icon": "/".

image

I'll see if I can add that as the native behaviour and hopefully that's the last of Git Bash' shenanigans. I do promote the use of nushell when you dislike PowerShell on Windows, that's a really, really good shell that integrates natively with Windows unlike Git Bash.

@Bilge
Copy link
Author

Bilge commented Jun 15, 2024

I guess changing folder_separator_icon is an OK workaround, but perhaps a bug should be filed with git-for-windows/git?

@JanDeDobbeleer
Copy link
Owner

@Bilge I can reproduce the issue on bash anywhere using "folder_separator_icon": "\\" so it's some sort of magical bash issue. The \ character is escaped, yet it has this strange side effect. I can definitely make sure this will always fallback to / on bash, but weird nonetheless.

@JanDeDobbeleer
Copy link
Owner

@Bilge after a good night's rest, I found the issue and oh-my-posh is responsible. We escape \ as it's used inside PS1 to control escape sequences and substitution, but it resulted in having the incorrect prompt length count. I have a draft ready that needs one more addition before being able to merge, but can confirm this is cleaner and solves the issue entirely.

image

@hungnguyen1503
Copy link

Hi @JanDeDobbeleer,

I have a problem after using the latest version. Could you please support me to fix it?
image

@JanDeDobbeleer
Copy link
Owner

@hungnguyen1503 set COLUMNS=0 just before the oh-my-posh init line. I'll fix it ASAP. Wasn't aware there were bash versions that do not set that variable.

@hungnguyen1503
Copy link

Hi @JanDeDobbeleer,
It was fixed, thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
3 participants