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

Linux OS labels can't be customized when display_distro_name is true #5011

Closed
1 task done
helpimnotdrowning opened this issue Jun 6, 2024 · 2 comments · Fixed by #5014
Closed
1 task done

Linux OS labels can't be customized when display_distro_name is true #5011

helpimnotdrowning opened this issue Jun 6, 2024 · 2 comments · Fixed by #5014
Assignees
Labels
🚀 feat New feature

Comments

@helpimnotdrowning
Copy link

Code of Conduct

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

What happened?

When writing a segment for my OS name, I wanted specific colors for some OSs and did not want to use the icons. Setting display_distro_name to true turns distros from icons to their names, but stops obeying the custom label specified in the properties.

I would like to be able to use my custom label for certain OSs that I use, and fallback to default for the rest, with the text label instead of the icon.

image

Theme

Custom theme based off of bundled tokyo.omp.json: 61c792.omp.json

What OS are you seeing the problem on?

Linux

Which shell are you using?

other (please specify)

Log output

Version: 21.2.2

Shell: pwsh (7.4.2)

Prompt:

[ helpimnotdrowning@URUHA] [ 0ss] [󰃰 2024-06-06 **:48:17 -**:00]
[~] [pwsh/debian]
る

Segments:

ConsoleTitle(true)                         -   1 ms
Session(true)                              -   0 ms
Executiontime(true)                        -   0 ms
Time(true)                                 -   0 ms
Git(false)                                 -   0 ms
Status(false)                              -   0 ms
Path(true)                                 -   0 ms
Shell(true)                                -   0 ms
Os(true)                                   -   0 ms
Text(true)                                 -   0 ms

Run duration: 6.005259ms

Cache path: /home/helpimnotdrowning/.cache/oh-my-posh

Config path: /home/helpimnotdrowning/config/61c792.omp.json

Logs:

[DEBUG] 00:48:17.444 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.444 shell.go:Getenv(TERM_PROGRAM) - 59.092µs
[DEBUG] 00:48:17.444 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.444 shell.go:Getenv(OMP_CACHE_DIR) - 4.582µs
[DEBUG] 00:48:17.444 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.444 shell.go:Getenv(XDG_CACHE_HOME) - 3.403µs
[TRACE] 00:48:17.444 shell_unix.go:CachePath() - 29.144µs
[DEBUG] 00:48:17.444 shell.go:Getenv:326 → /home/helpimnotdrowning/config/61c792.omp.json
[TRACE] 00:48:17.444 shell.go:Getenv(POSH_THEME) - 7.303µs
[DEBUG] 00:48:17.444 shell_unix.go:Platform:87 → debian
[TRACE] 00:48:17.444 shell.go:resolveConfigPath() - 26.193µs
[TRACE] 00:48:17.444 shell.go:Init() - 306.742µs
[TRACE] 00:48:17.444 shell.go:Flags() - 77ns
[TRACE] 00:48:17.445 config.go:loadConfig() - 837.873µs
[TRACE] 00:48:17.445 shell.go:Flags() - 70ns
[DEBUG] 00:48:17.445 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.445 shell.go:Getenv(OMP_CACHE_DISABLED) - 6.879µs
[DEBUG] 00:48:17.445 shell.go:Shell:601 → no shell name provided in flags, trying to detect it
[DEBUG] 00:48:17.445 shell.go:Shell:609 → process name: pwsh
[TRACE] 00:48:17.445 shell.go:Shell() - 665.79µs
[DEBUG] 00:48:17.445 shell.go:Getenv:326 → 7.4.2
[TRACE] 00:48:17.445 shell.go:Getenv(POSH_SHELL_VERSION) - 4.15µs
[DEBUG] 00:48:17.445 debug.go:PrintDebug:22 → Segment: Title
[DEBUG] 00:48:17.445 text.go:Render:71 → Rendering template: {{ .Shell }} in {{ .PWD }}
[TRACE] 00:48:17.446 shell_unix.go:Root() - 889ns
[TRACE] 00:48:17.446 shell.go:Shell() - 142ns
[TRACE] 00:48:17.446 shell.go:StatusCodes() - 199ns
[DEBUG] 00:48:17.446 shell_unix.go:IsWsl:35 → false
[TRACE] 00:48:17.446 shell_unix.go:IsWsl() - 9.193µs
[DEBUG] 00:48:17.446 shell.go:TemplateCache:782 → environment: [PATH=/opt/microsoft/powershell/7:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games POSH_THEME=/home/helpimnotdrowning/config/61c792.omp.json MOTD_SHOWN=pam SSH_CONNECTION=*.*.*.* 23032 *.*.*.* 22 XDG_SESSION_CLASS=user HOME=/home/helpimnotdrowning POSH_SHELL_VERSION=7.4.2 POSH_PID=381527 LOGNAME=helpimnotdrowning DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus POSH_GIT_ENABLED=False CONDA_PROMPT_MODIFIER=False PSModulePath=/home/helpimnotdrowning/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules XDG_SESSION_TYPE=tty POSH_AZURE_ENABLED=False POSH_CURSOR_LINE=30 LANG=en_US.UTF-8 net_helpimnotdrowning_RandomHostnameColorGenerator_HostnameColor=#358C33 XDG_RUNTIME_DIR=/run/user/1000 USER=helpimnotdrowning XDG_SESSION_ID=616 XDG_DATA_DIRS=/home/helpimnotdrowning/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share PWD=/home/helpimnotdrowning SSH_CLIENT=*.*.*.* 23032 22 POWERLINE_COMMAND=oh-my-posh TERM=xterm-256color SSH_TTY=/dev/pts/2 SHELL=/usr/bin/pwsh POSH_CURSOR_COLUMN=1]
[TRACE] 00:48:17.446 shell.go:GOOS() - 173ns
[DEBUG] 00:48:17.446 shell.go:Pwd:356 → /home/helpimnotdrowning
[TRACE] 00:48:17.446 shell.go:Pwd() - 24.496µs
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 39ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 42ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 42ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 39ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 48ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 38ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 42ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 42ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 41ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 39ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.446 shell.go:GOOS() - 40ns
[DEBUG] 00:48:17.446 shell.go:User:494 → helpimnotdrowning
[TRACE] 00:48:17.446 shell.go:User() - 3.753µs
[DEBUG] 00:48:17.446 shell.go:Host:511 → URUHA
[TRACE] 00:48:17.446 shell.go:Host() - 5.83µs
[TRACE] 00:48:17.446 shell.go:GOOS() - 114ns
[DEBUG] 00:48:17.446 shell_unix.go:Platform:87 → debian
[DEBUG] 00:48:17.446 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.446 shell.go:Getenv(SHLVL) - 3.868µs
[TRACE] 00:48:17.446 shell.go:TemplateCache() - 446.298µs
[DEBUG] 00:48:17.446 shell.go:Getenv:326 → 30
[TRACE] 00:48:17.446 shell.go:Getenv(POSH_CURSOR_LINE) - 26.489µs
[DEBUG] 00:48:17.446 shell.go:Getenv:326 → 1
[TRACE] 00:48:17.446 shell.go:Getenv(POSH_CURSOR_COLUMN) - 4.859µs
[TRACE] 00:48:17.446 shell.go:Flags() - 82ns
[TRACE] 00:48:17.446 shell.go:Flags() - 56ns
[TRACE] 00:48:17.446 shell.go:Shell() - 94ns
[TRACE] 00:48:17.446 shell.go:Shell() - 58ns
[TRACE] 00:48:17.447 shell.go:Flags() - 176ns
[TRACE] 00:48:17.447 shell.go:Flags() - 109ns
[TRACE] 00:48:17.447 shell.go:Pwd() - 196ns
[TRACE] 00:48:17.447 shell.go:GOOS() - 75ns
[DEBUG] 00:48:17.447 properties.go:GetString:28 → {{ .Code }}
[DEBUG] 00:48:17.447 segment.go:SetEnabled:533 → Segment: Executiontime
[TRACE] 00:48:17.447 shell.go:Pwd() - 228ns
[TRACE] 00:48:17.447 shell.go:GOOS() - 79ns
[DEBUG] 00:48:17.447 segment.go:SetEnabled:533 → Segment: Status
[DEBUG] 00:48:17.447 properties.go:GetBool:22 → always_enabled: false
[TRACE] 00:48:17.447 shell.go:ExecutionTime() - 187ns
[DEBUG] 00:48:17.447 text.go:Render:71 → Rendering template: {{ .Code }}
[DEBUG] 00:48:17.447 properties.go:GetFloat64:34 → threshold: 0.000000
[DEBUG] 00:48:17.447 properties.go:GetString:28 → amarillo
[TRACE] 00:48:17.447 shell.go:TemplateCache() - 201ns
[TRACE] 00:48:17.447 shell.go:Flags() - 60ns
[TRACE] 00:48:17.447 shell.go:Pwd() - 113ns
[TRACE] 00:48:17.447 shell.go:GOOS() - 49ns
[DEBUG] 00:48:17.447 segment.go:SetEnabled:533 → Segment: Time
[DEBUG] 00:48:17.447 properties.go:GetString:28 → 2006-01-02 15:04:05 -07:00
[TRACE] 00:48:17.447 shell.go:TemplateCache() - 86ns
[TRACE] 00:48:17.447 shell.go:Flags() - 43ns
[TRACE] 00:48:17.447 shell.go:Pwd() - 95ns
[TRACE] 00:48:17.447 shell.go:GOOS() - 42ns
[DEBUG] 00:48:17.447 segment.go:SetEnabled:533 → Segment: Git
[DEBUG] 00:48:17.447 shell_unix.go:IsWsl:35 → false
[TRACE] 00:48:17.447 shell_unix.go:IsWsl() - 8.862µs
[TRACE] 00:48:17.447 shell_unix.go:IsWsl2() - 12.932µs
[TRACE] 00:48:17.447 shell.go:GOOS() - 49ns
[DEBUG] 00:48:17.447 shell.go:CommandPath:553 → /usr/bin/git
[TRACE] 00:48:17.447 shell.go:CommandPath(git) - 27.353µs
[TRACE] 00:48:17.447 shell.go:HasCommand(git) - 31.683µs
[TRACE] 00:48:17.447 shell.go:Pwd() - 151ns
[ERROR] 00:48:17.447 shell.go:HasParentFilePath:697 → stat .git: no such file or directory
[TRACE] 00:48:17.447 shell.go:HasParentFilePath(.git) - 19.07µs
[DEBUG] 00:48:17.447 properties.go:GetBool:22 → fetch_bare_info: false
[TRACE] 00:48:17.447 shell.go:Flags() - 60ns
[TRACE] 00:48:17.447 shell.go:Pwd() - 145ns
[TRACE] 00:48:17.447 shell.go:GOOS() - 56ns
[DEBUG] 00:48:17.447 segment.go:SetEnabled:533 → Segment: Session
[DEBUG] 00:48:17.447 shell.go:Getenv:326 → *.*.*.* 23032 *.*.*.* 22
[TRACE] 00:48:17.447 shell.go:Getenv(SSH_CONNECTION) - 12.287µs
[TRACE] 00:48:17.447 shell.go:TemplateCache() - 152ns
[TRACE] 00:48:17.447 shell.go:TemplateCache() - 334ns
[DEBUG] 00:48:17.447 properties.go:GetBool:22 → always_enabled: false
[DEBUG] 00:48:17.447 text.go:Render:71 → Rendering template: [{{if .Root}}<white></> <black,white>{{ .UserName }}</>{{else}}<white></> {{ .UserName }}{{end}}@<{{.Env.nhnd_HostnameColor}}>{{ .HostName }}</>]
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template:  [<white></> {{ .FormattedMs }}s]
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template:  [<white>󰃰</> {{ .CurrentDate | date .Format }}]
[TRACE] 00:48:17.448 shell.go:TemplateCache() - 296ns
[TRACE] 00:48:17.448 shell.go:Shell() - 97ns
[TRACE] 00:48:17.448 shell.go:TemplateCache() - 265ns
[TRACE] 00:48:17.448 shell.go:Shell() - 164ns
[TRACE] 00:48:17.448 shell.go:TemplateCache() - 230ns
[TRACE] 00:48:17.448 shell.go:Shell() - 112ns
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template: plain
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template: diamond
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template: diamond
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template: plain
[DEBUG] 00:48:17.448 text.go:Render:71 → Rendering template: powerline
[TRACE] 00:48:17.448 shell.go:Shell() - 152ns
[TRACE] 00:48:17.448 shell.go:Shell() - 49ns
[TRACE] 00:48:17.448 shell.go:Shell() - 55ns
[TRACE] 00:48:17.448 shell.go:Flags() - 101ns
[TRACE] 00:48:17.448 shell.go:Pwd() - 215ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 62ns
[DEBUG] 00:48:17.448 segment.go:SetEnabled:533 → Segment: Os
[TRACE] 00:48:17.448 shell.go:GOOS() - 56ns
[DEBUG] 00:48:17.448 shell_unix.go:Platform:87 → debian
[DEBUG] 00:48:17.448 properties.go:GetBool:22 → display_distro_name: true
[TRACE] 00:48:17.448 shell.go:TemplateCache() - 129ns
[TRACE] 00:48:17.448 shell.go:Flags() - 40ns
[TRACE] 00:48:17.448 shell.go:Pwd() - 82ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 50ns
[DEBUG] 00:48:17.448 segment.go:SetEnabled:533 → Segment: Path
[TRACE] 00:48:17.448 shell.go:Pwd() - 64ns
[TRACE] 00:48:17.448 shell.go:Shell() - 81ns
[TRACE] 00:48:17.448 shell.go:Flags() - 44ns
[DEBUG] 00:48:17.448 properties.go:GetBool:22 → mapped_locations_enabled: true
[DEBUG] 00:48:17.448 properties.go:GetString:28 → 
[DEBUG] 00:48:17.448 properties.go:GetString:28 → 
[TRACE] 00:48:17.448 shell.go:GOOS() - 65ns
[DEBUG] 00:48:17.448 properties.go:GetString:28 → ~
[DEBUG] 00:48:17.448 properties.go:GetKeyValueMap:46 → mapped_locations: map[]
[TRACE] 00:48:17.448 shell.go:PathSeparator() - 158ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 42ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 41ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 62ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 53ns
[TRACE] 00:48:17.448 shell.go:PathSeparator() - 54ns
[TRACE] 00:48:17.448 shell.go:PathSeparator() - 53ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.448 shell.go:PathSeparator() - 46ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 39ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 40ns
[TRACE] 00:48:17.448 shell.go:PathSeparator() - 38ns
[TRACE] 00:48:17.448 shell.go:GOOS() - 43ns
[TRACE] 00:48:17.449 shell.go:GOOS() - 45ns
[TRACE] 00:48:17.449 shell.go:PathSeparator() - 61ns
[DEBUG] 00:48:17.449 properties.go:GetString:28 → awa
[TRACE] 00:48:17.449 shell.go:Pwd() - 108ns
[ERROR] 00:48:17.449 shell.go:HasParentFilePath:697 → stat .git: no such file or directory
[TRACE] 00:48:17.449 shell.go:HasParentFilePath(.git) - 20.865µs
[TRACE] 00:48:17.449 shell.go:PathSeparator() - 57ns
[TRACE] 00:48:17.449 shell.go:Pwd() - 89ns
[DEBUG] 00:48:17.449 shell_unix.go:IsWsl:35 → false
[TRACE] 00:48:17.449 shell_unix.go:IsWsl() - 4.486µs
[TRACE] 00:48:17.449 shell.go:StackCount() - 114ns
[TRACE] 00:48:17.449 shell_unix.go:DirIsWritable(/home/helpimnotdrowning) - 8.034µs
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 119ns
[TRACE] 00:48:17.449 shell.go:Flags() - 64ns
[TRACE] 00:48:17.449 shell.go:Pwd() - 90ns
[TRACE] 00:48:17.449 shell.go:GOOS() - 47ns
[DEBUG] 00:48:17.449 segment.go:SetEnabled:533 → Segment: Shell
[DEBUG] 00:48:17.449 properties.go:GetKeyValueMap:46 → mapped_shell_names: map[]
[TRACE] 00:48:17.449 shell.go:Shell() - 85ns
[TRACE] 00:48:17.449 shell.go:Flags() - 46ns
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 91ns
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: {{.Icon}}]
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 245ns
[TRACE] 00:48:17.449 shell.go:Shell() - 83ns
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: [{{if .Root}}<black,white>{{ .Path }}</>{{else}}{{ .Path }}{{end}}]
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 229ns
[TRACE] 00:48:17.449 shell.go:Shell() - 80ns
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template:  [{{.Shell}}/
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 200ns
[TRACE] 00:48:17.449 shell.go:Shell() - 78ns
[DEBUG] 00:48:17.449 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.449 shell.go:Getenv(TERM_PROGRAM) - 3.798µs
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: plain
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: powerline
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: plain
[TRACE] 00:48:17.449 shell.go:Shell() - 76ns
[TRACE] 00:48:17.449 shell.go:Shell() - 52ns
[TRACE] 00:48:17.449 shell.go:Shell() - 48ns
[TRACE] 00:48:17.449 shell.go:Flags() - 68ns
[TRACE] 00:48:17.449 shell.go:Pwd() - 141ns
[TRACE] 00:48:17.449 shell.go:GOOS() - 63ns
[DEBUG] 00:48:17.449 segment.go:SetEnabled:533 → Segment: Text
[TRACE] 00:48:17.449 shell.go:TemplateCache() - 98ns
[DEBUG] 00:48:17.449 text.go:Render:71 → Rendering template: る
[TRACE] 00:48:17.449 shell.go:Shell() - 74ns
[DEBUG] 00:48:17.449 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.449 shell.go:Getenv(TERM_PROGRAM) - 3.21µs
[DEBUG] 00:48:17.450 text.go:Render:71 → Rendering template: plain
[TRACE] 00:48:17.450 shell.go:Shell() - 65ns
[TRACE] 00:48:17.450 shell.go:Flags() - 52ns
[TRACE] 00:48:17.450 shell.go:Shell() - 54ns
[TRACE] 00:48:17.450 shell.go:Shell() - 41ns
[DEBUG] 00:48:17.450 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.450 shell.go:Getenv(OMP_CACHE_DIR) - 3.997µs
[DEBUG] 00:48:17.450 shell.go:Getenv:326 → NO DATA
[TRACE] 00:48:17.450 shell.go:Getenv(XDG_CACHE_HOME) - 4.135µs
[TRACE] 00:48:17.450 shell_unix.go:CachePath() - 31.807µs
[TRACE] 00:48:17.450 shell.go:Flags() - 58ns
@helpimnotdrowning helpimnotdrowning added the 🐛 bug Something isn't working label Jun 6, 2024
@JanDeDobbeleer JanDeDobbeleer added 🚀 feat New feature and removed 🐛 bug Something isn't working labels Jun 6, 2024
@JanDeDobbeleer
Copy link
Owner

@helpimnotdrowning wait, what's stopping you from not setting display_distro_name to true and keep the override? That has the exact same result, no? The overrides are meant for the icon, display_distro_name implies using only the name.

@helpimnotdrowning
Copy link
Author

Sorry for not responding, I'd fallen asleep already, but thanks for the incredibly fast patch!!
image

aaronpowell pushed a commit to aaronpowell/oh-my-posh that referenced this issue Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚀 feat New feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants