JanDeDobbeleer / oh-my-posh

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

Certain characters display at half-size with oh-my-posh #5880

Closed Nidrax closed 1 week ago

Nidrax commented 1 week ago

Code of Conduct

What happened?

I am setting up a custom theme inspired by powerlevel10k and I noticed that the house icons (tested with \uf015 [nf-fa-house] and \uef85 [nf-fa-house_chimney]) are displayed at half the size compared to when used in p10k prompt when using oh-my-zsh.

The issue seems to replicate across all the Nerd Fonts I have. Screens (above: p10k, below: omp)

JetBrainsMono Nerd Font image

SpaceMono Nerd Font image

UbuntuMono Nerd Font image

Agave Nerd Font image

Theme

cat dotfiles/.config/ohmyposh/p10k.yaml
# yaml-language-server: $schema=https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json

console_title_template: "{{ .Shell }} in {{ .Folder }}"
blocks:
- type: prompt
  alignment: left
  segments:
  - template: " {{.Icon}}  "
    foreground: "007"
    background: "012"
    foreground_templates:
    - '{{ if contains "Ubuntu" .OS }}#ffffff{{ end }}'
    - '{{ if contains "endeavouros" .OS }}#ffffff{{ end }}'
    background_templates:
    - '{{ if contains "Ubuntu" .OS }}#dd6726{{ end }}'
    - '{{ if contains "endeavouros" .OS }}#7f3fbf{{ end }}'
    type: os
    style: diamond
  - properties:
      home_icon: "~"
      style: agnoster_short
    template: " <b>{{ if ne \"~\" .PWD }}\uf07c {{ else }}\uf015⠀{{ end }}{{ .Path }}</b> "
    foreground: "0"
    powerline_symbol: 
    background: "4"
    type: path
    style: powerline
  - properties:
      branch_icon: "\uf126 "
      fetch_stash_count: true
      fetch_status: true
      fetch_upstream_icon: true
      mapped_branches:
        bug/*: "🐛 "
        feature/*: "🚀 "
      source: cli
    template: " {{ .UpstreamIcon }}{{ .HEAD }}{{ 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 }} \ueb4b {{ .StashCount }}{{ end }} "
    foreground: "0"
    powerline_symbol: 
    background: "2"
    type: git
    style: powerline
    background_templates:
    - "{{ if or (.Working.Changed) (.Staging.Changed) }}3{{ end }}"
    - "{{ if and (gt .Ahead 0) (gt .Behind 0) }}1{{ end }}"
    - "{{ if gt .Ahead 0 }}6{{ end }}"
    - "{{ if gt .Behind 0 }}215{{ end }}"
version: 3
final_space: true

What OS are you seeing the problem on?

OS: EndeavourOS 2024.09.22 Kernel: 6.11.3-arch1-1 WM: i3wm 4.23

Which shell are you using?

kitty 0.36.4

Log output

Version: 24.3.0

Shell: zsh (5.9)

Prompt:

    ⠀~  

Segments:

ConsoleTitle(true)                        -   0 ms
Os(true)                                  -   0 ms
Path(true)                                -   0 ms
Git(false)                                -   0 ms

Run duration: 4.075017ms

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

Config path: /home/nidrax/.config/ohmyposh/p10k.yaml

Logs:

[DEBUG] 15:18:09.453 debug.go:49 → debug mode enabled
[DEBUG] 15:18:09.453 debug.go:49 → plain mode enabled
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(LOCALAPPDATA) - 15.813µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(OMP_CACHE_DIR) - 3.415µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(XDG_CACHE_HOME) - 2.804µs
[TRACE] 15:18:09.453 terminal.go:CachePath() - 57.111µs
[DEBUG] 15:18:09.453 terminal.go:65 → loading cache file: /home/nidrax/.cache/oh-my-posh/omp.cache
[DEBUG] 15:18:09.453 terminal.go:65 → loading cache key: environment_platform
[DEBUG] 15:18:09.453 terminal.go:65 → loading cache key: is_wsl
[TRACE] 15:18:09.453 terminal.go(/home/nidrax/.cache/oh-my-posh/omp.cache) - 100.443µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(LOCALAPPDATA) - 3.489µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(OMP_CACHE_DIR) - 2.832µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.453 terminal.go:Getenv(XDG_CACHE_HOME) - 2.771µs
[TRACE] 15:18:09.453 terminal.go:CachePath() - 32.616µs
[DEBUG] 15:18:09.453 terminal.go:65 → loading cache file: /home/nidrax/.cache/oh-my-posh/omp.cache.4947c671-305a-4888-8e18-c19169977a33
[DEBUG] 15:18:09.453 terminal.go:65 → loading cache key: prompt_count_cache
[TRACE] 15:18:09.453 terminal.go(/home/nidrax/.cache/oh-my-posh/omp.cache.4947c671-305a-4888-8e18-c19169977a33) - 38.336µs
[TRACE] 15:18:09.453 terminal.go:setPromptCount() - 767ns
[TRACE] 15:18:09.453 terminal.go:GOOS() - 76ns
[DEBUG] 15:18:09.453 terminal.go:setPwd:194 → /home/nidrax
[TRACE] 15:18:09.453 terminal.go:setPwd() - 14.726µs
[DEBUG] 15:18:09.453 terminal.go:Getenv:161 → /home/nidrax/.config/ohmyposh/p10k.yaml
[TRACE] 15:18:09.453 terminal.go:Getenv(POSH_THEME) - 3.75µs
[DEBUG] 15:18:09.453 terminal.go:ResolveConfigPath:93 → config set using POSH_THEME: /home/nidrax/.config/ohmyposh/p10k.yaml
[TRACE] 15:18:09.453 terminal.go:ResolveConfigPath() - 12.191µs
[TRACE] 15:18:09.453 terminal.go:Init() - 387.061µs
[TRACE] 15:18:09.453 terminal.go:Shell() - 186ns
[TRACE] 15:18:09.453 terminal.go:Flags() - 101ns
[TRACE] 15:18:09.454 load.go:loadConfig() - 711.543µs
[TRACE] 15:18:09.454 terminal.go:Flags() - 61ns
[DEBUG] 15:18:09.454 debug.go:59 → terminal program: Unknown
[DEBUG] 15:18:09.454 debug.go:59 → terminal shell: zsh
[DEBUG] 15:18:09.454 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.454 terminal.go:Getenv(OMP_CACHE_DISABLED) - 3.852µs
[TRACE] 15:18:09.454 colors.go:SetAccentColor() - 930ns
[TRACE] 15:18:09.454 terminal.go:Shell() - 102ns
[DEBUG] 15:18:09.454 terminal.go:Getenv:161 → 5.9
[TRACE] 15:18:09.454 terminal.go:Getenv(POSH_SHELL_VERSION) - 3.855µs
[DEBUG] 15:18:09.454 debug.go:PrintDebug:23 → segment: Title
[TRACE] 15:18:09.454 terminal_unix.go:Root() - 1.469µs
[TRACE] 15:18:09.454 terminal.go:Shell() - 153ns
[TRACE] 15:18:09.455 terminal.go:StatusCodes() - 82ns
[DEBUG] 15:18:09.455 terminal_unix.go:IsWsl:35 → false
[TRACE] 15:18:09.455 terminal_unix.go:IsWsl() - 9.774µs
[DEBUG] 15:18:09.455 terminal_unix.go:IsWsl:35 → false
[TRACE] 15:18:09.455 terminal_unix.go:IsWsl() - 3.51µs
[TRACE] 15:18:09.455 terminal.go:GOOS() - 66ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 36ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 51ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 33ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 33ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 34ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 30ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 36ns
[DEBUG] 15:18:09.455 terminal.go:User:331 → nidrax
[TRACE] 15:18:09.455 terminal.go:User() - 4.159µs
[DEBUG] 15:18:09.455 terminal.go:Host:348 → nidrax-endeavouros
[TRACE] 15:18:09.455 terminal.go:Host() - 5.908µs
[TRACE] 15:18:09.455 terminal.go:GOOS() - 36ns
[DEBUG] 15:18:09.455 terminal_unix.go:Platform:95 → endeavouros
[DEBUG] 15:18:09.455 terminal.go:Getenv:161 → 1
[TRACE] 15:18:09.455 terminal.go:Getenv(SHLVL) - 3.88µs
[TRACE] 15:18:09.455 terminal.go:TemplateCache() - 104.273µs
[TRACE] 15:18:09.455 text.go:Render({{ .Shell }} in {{ .Folder }}) - 342.617µs
[TRACE] 15:18:09.455 terminal.go:Flags() - 61ns
[DEBUG] 15:18:09.455 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.455 terminal.go:Getenv(POSH_CURSOR_LINE) - 3.397µs
[DEBUG] 15:18:09.455 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.455 terminal.go:Getenv(POSH_CURSOR_COLUMN) - 2.813µs
[TRACE] 15:18:09.455 terminal.go:Flags() - 42ns
[TRACE] 15:18:09.455 terminal.go:Flags() - 34ns
[TRACE] 15:18:09.455 terminal.go:Flags() - 34ns
[TRACE] 15:18:09.455 terminal.go:GOOS() - 77ns
[TRACE] 15:18:09.455 terminal.go:Flags() - 275ns
[DEBUG] 15:18:09.455 segment.go:Execute:108 → segment: Git
[TRACE] 15:18:09.455 terminal.go:GOOS() - 83ns
[DEBUG] 15:18:09.455 terminal_unix.go:IsWsl:35 → false
[DEBUG] 15:18:09.455 segment.go:Execute:108 → segment: Path
[TRACE] 15:18:09.455 terminal_unix.go:IsWsl() - 4.262µs
[TRACE] 15:18:09.455 terminal_unix.go:IsWsl2() - 7.846µs
[TRACE] 15:18:09.455 terminal.go:GOOS() - 47ns
[DEBUG] 15:18:09.455 terminal.go:CommandPath:395 → /usr/bin/git
[TRACE] 15:18:09.455 terminal.go:CommandPath(git) - 552.084µs
[TRACE] 15:18:09.455 terminal.go:HasCommand(git) - 565.89µs
[DEBUG] 15:18:09.455 git.go:shouldDisplay:326 → fetch_bare_info: false
[TRACE] 15:18:09.455 terminal.go:Flags() - 324ns
[DEBUG] 15:18:09.455 terminal.go:ResolveSymlink:287 → /home/nidrax
[TRACE] 15:18:09.455 terminal.go:ResolveSymlink(/home/nidrax) - 15.521µs
[ERROR] 15:18:09.455 terminal.go:HasParentFilePath:559 → stat .git: no such file or directory
[TRACE] 15:18:09.455 terminal.go:HasParentFilePath(.git) - 44.269µs
[TRACE] 15:18:09.456 terminal.go:GOOS() - 239ns
[DEBUG] 15:18:09.456 segment.go:Execute:108 → segment: Os
[TRACE] 15:18:09.456 terminal.go:GOOS() - 76ns
[DEBUG] 15:18:09.456 terminal_unix.go:Platform:95 → endeavouros
[DEBUG] 15:18:09.456 os.go:Enabled:38 → display_distro_name: false
[DEBUG] 15:18:09.456 os.go:getDistroIcon:83 → 
[TRACE] 15:18:09.456 terminal.go:TemplateCache() - 224ns
[TRACE] 15:18:09.456 text.go:Render( {{.Icon}}  ) - 225.48µs
[TRACE] 15:18:09.456 terminal.go:TemplateCache() - 211ns
[TRACE] 15:18:09.456 text.go:Render({{ if contains "Ubuntu" .OS }}#dd6726{{ end }}) - 142.187µs
[TRACE] 15:18:09.456 text.go:Render({{ if contains "endeavouros" .OS }}#7f3fbf{{ end }}) - 34.298µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "Ubuntu" .OS }}#ffffff{{ end }}) - 541.083µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "endeavouros" .OS }}#ffffff{{ end }}) - 24.308µs
[TRACE] 15:18:09.457 text.go:Render(diamond) - 248ns
[TRACE] 15:18:09.457 text.go:Render({{ if contains "Ubuntu" .OS }}#dd6726{{ end }}) - 21.95µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "endeavouros" .OS }}#7f3fbf{{ end }}) - 14.545µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "Ubuntu" .OS }}#ffffff{{ end }}) - 12.735µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "endeavouros" .OS }}#ffffff{{ end }}) - 12.032µs
[TRACE] 15:18:09.457 text.go:Render( <b>{{ if ne "~" .PWD }} {{ else }}⠀{{ end }}{{ .Path }}</b> ) - 55.531µs
[TRACE] 15:18:09.457 terminal.go:TemplateCache() - 77ns
[TRACE] 15:18:09.457 text.go:Render(powerline) - 175ns
[TRACE] 15:18:09.457 text.go:Render({{ if contains "Ubuntu" .OS }}#dd6726{{ end }}) - 17.505µs
[TRACE] 15:18:09.457 text.go:Render({{ if contains "endeavouros" .OS }}#7f3fbf{{ end }}) - 11.728µs
[TRACE] 15:18:09.457 text.go:Render(powerline) - 177ns
[TRACE] 15:18:09.457 terminal.go:Shell() - 92ns
[TRACE] 15:18:09.457 terminal.go:Shell() - 37ns
[TRACE] 15:18:09.457 terminal.go:Flags() - 48ns
[TRACE] 15:18:09.457 terminal.go:Shell() - 25ns
[TRACE] 15:18:09.457 terminal.go:Flags() - 33ns
[DEBUG] 15:18:09.457 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.457 terminal.go:Getenv(LOCALAPPDATA) - 4.07µs
[DEBUG] 15:18:09.457 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.457 terminal.go:Getenv(OMP_CACHE_DIR) - 2.563µs
[DEBUG] 15:18:09.457 terminal.go:Getenv:161 → NO DATA
[TRACE] 15:18:09.457 terminal.go:Getenv(XDG_CACHE_HOME) - 2.172µs
[TRACE] 15:18:09.457 terminal.go:CachePath() - 34.528µs
[TRACE] 15:18:09.457 terminal.go:Flags() - 52ns
JanDeDobbeleer commented 1 week ago

@Nidrax this isn't an oh-my-posh issue as we only output the icon. There's no way for us to influence its appearance, that's a font or terminal difference.

Nidrax commented 1 week ago

Okay, I played with the font a bit and it seems it's an issue with how kitty displays ligatures. If I used a non-breaking space (\u00a0) after the icon character it makes it small. Seems like something to report on kitty repo. Sorry for the inconvenience

JanDeDobbeleer commented 1 week ago

@Nidrax not at all, this is useful information 👍🏻