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

Lightning icon (⚡) adds extra space in prompt with some fonts #1073

Closed SharakPL closed 2 years ago

SharakPL commented 2 years ago

Code of Conduct

What happened?

With any NerdFont i get extraspace. Happens with FiraCode NF, FuraCode NF, JetBrainsMono NF and also official releases of Cascadia Code, JetBrains Mono, etc.

obraz

On most of the system fonts, official Fira Code or FiraCode Retina it all looks correct, but of course with them I miss all or most of powerline glyphs.

obraz

It looks like this character is designed to occupy 2 places, but NerdFonts and few others force it to 1, but prompt still reserves 2 places for it.

I'd like to use original JetBrains Mono in my terminal as all NF versions of all fonts ruin original glyphs instead of simply adding new ones ☹

Version

5.9.0

Theme

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "final_space": true,
  "console_title": true,
  "blocks": [
    {
      "type": "prompt",
      "alignment": "left",
      "segments": [
        {
          "type": "time",
          "style": "powerline",
          "foreground": "#fff",
          "background": "#9d38aa",
          "properties": {
            "time_format": "15:04:05"
          }
        },
        {
          "type": "root",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#d40000",
          "background": "#fbff00",
          "properties": {
            "root_icon": "⚡"
          }
        },
        {
          "type": "path",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#fff",
          "background": "#403ec4",
          "properties": {
            "style": "agnoster_full",
            "folder_separator_icon": "│"
          }
        },
        {
          "type": "git",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#1ffdf2",
          "background": "#1d1e20",
          "properties": {
            "display_branch_status": true,
            "display_status_detail": true,
            "display_worktree_count": true,
            "display_status": true,
            "staging_color": "#08c502",
            "working_color": "#e2d300",
            "ahead_and_behind_color": "#fc63a3",
            "branch_icon": "",
            "tag_icon": "⌂",
            "branch_gone_icon": "≢ ",
            "branch_ahead_icon": "↥",
            "local_staged_icon": "✓",
            "branch_behind_icon": "↧",
            "local_working_icon": "✶",
            "branch_identical_icon": "≡ ",
            "status_separator_icon": " │ "
          }
        },
        {
          "type": "exit",
          "style": "powerline",
          "powerline_symbol": "",
          "foreground": "#fff",
          "background": "#19bd0a",
          "properties": {
            "always_enabled": true,
            "color_background": true,
            "display_exit_code": true,
            "always_numeric": true,
            "error_color": "#e21111"
          }
        }
      ]
    }
  ]
}

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Relevant log output

No response

JanDeDobbeleer commented 2 years ago

@SharakPL that's a lovely Windows Terminal bug. See here for more information on how to resolve it.

SharakPL commented 2 years ago

Thanks. This fixed it for me:

"properties": {
    "root_icon": "⚡",
    "postfix": "\u2800"
}
SharakPL commented 2 years ago

Actually it works without postfix, but with official Cascadia Code PL and Cascadia Mono PL. I see it has italic variants now so I'll stick with this one :)

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