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

The width of the theme icon is displayed abnormally #2275

Closed
1 task done
SamotoKuen opened this issue May 16, 2022 · 6 comments
Closed
1 task done

The width of the theme icon is displayed abnormally #2275

SamotoKuen opened this issue May 16, 2022 · 6 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@SamotoKuen
Copy link

SamotoKuen commented May 16, 2022

Code of Conduct

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

What happened?

The width of the icon is fixed and the excess is hidden ,The width is not adaptive.Tried several fonts and themes (jandedobbeleer,amro,cert etc)don't work

Version

  1. powershell: 7.2.3
  2. oh-my-posh: 7.8.5.0
  3. windows10:21H2

font

  1. MesloLGL NF
  2. JetBrainsMono NF
  • windows-terminal error pic
    error-terminal
    -vscode error pic
    error-vscode

  • theme config

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "#003543",
          "foreground": "#00c983",
          "leading_diamond": "\ue0b6",
          "style": "diamond",
          "template": "{{ .Icon }} {{ .HostName }} ",
          "type": "os"
        },
        {
          "background": "#DA627D",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "folder_icon": "\uf115",
            "folder_separator_icon": "\\",
            "home_icon": "\uf7db",
            "style": "full"
          },
          "style": "powerline",
          "template": " <#000>\uf07b \uf553</> {{ .Path }} ",
          "type": "path"
        },
        {
          "background": "#FCA17D",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": " <#ffffff>\ue0a0 </>",
            "fetch_stash_count": true,
            "fetch_status": false,
            "fetch_upstream_icon": true
          },
          "style": "powerline",
          "template": " \u279c ({{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uf692 {{ .StashCount }}{{ end }}) ",
          "type": "git"
        },
        {
          "background": "#76b367",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
          "type": "node"
        },
        {
          "background": "#83769c",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "always_enabled": true
          },
          "style": "powerline",
          "template": " \ufbab {{ .FormattedMs }} ",
          "type": "executiontime"
        },
        {
          "background": "#33658A",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "time_format": "3:04 PM"
          },
          "style": "powerline",
          "template": " \uf017 {{ .CurrentDate | date .Format }} ",
          "type": "time"
        },
        {
          "background": "#2e9599",
          "background_templates": [
            "{{ if gt .Code 0 }}red{{ end }}"
          ],
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "always_enabled": true
          },
          "style": "diamond",
          "template": " {{ if gt .Code 0 }}\uf525{{ else }}\uf469{{ end }}",
          "trailing_diamond": "\ue0b4",
          "type": "exit"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#cd5e42",
          "style": "plain",
          "template": "\ue3bf ",
          "type": "root"
        },
        {
          "foreground": "#CD4277",
          "style": "plain",
          "template": " <#45F1C2><b>\u26a1</b></><b>{{ .UserName }}</b> <#26C6DA>\u276f</><#45F1C2>\u276f</>",
          "type": "text"
        }
      ],
      "type": "prompt"
    }
  ],
  "final_space": true,
  "version": 2
}

Theme

montys

What OS are you seeing the problem on?

Windows

Which shell are you using?

powershell

Log output

Logs:

2022/05/16 17:06:40 debug: Getenv
C:\Users\dio\AppData\Local
2022/05/16 17:06:40 Getenv duration: 505.2µs, args: LOCALAPPDATA
2022/05/16 17:06:40 CachePath duration: 524.5µs, args:
2022/05/16 17:06:40 debug: Getenv
C:\Users\dio\.posh_themes\montys.omp.json
2022/05/16 17:06:40 Getenv duration: 0s, args: POSH_THEME
2022/05/16 17:06:40 Shell duration: 7.3983ms, args:
2022/05/16 17:06:40 resolveConfigPath duration: 7.3983ms, args:
2022/05/16 17:06:40 Init duration: 7.9228ms, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
2022/05/16 17:06:40 config.loadConfig duration: 526µs, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
2022/05/16 17:06:40 debug: Getenv

2022/05/16 17:06:40 Getenv duration: 0s, args: OMP_CACHE_DISABLED
2022/05/16 17:06:40 Root duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 ErrorCode duration: 0s, args:
2022/05/16 17:06:40 IsWsl duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 PathSeparator duration: 0s, args:
2022/05/16 17:06:40 PathSeparator duration: 0s, args:
2022/05/16 17:06:40 debug: User
dio
2022/05/16 17:06:40 User duration: 0s, args:
2022/05/16 17:06:40 debug: Host
DESKTOP-FPR50OU
2022/05/16 17:06:40 Host duration: 0s, args:
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 PathSeparator duration: 0s, args:
2022/05/16 17:06:40 PathSeparator duration: 0s, args:
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 IsWsl duration: 0s, args:
2022/05/16 17:06:40 StackCount duration: 0s, args:
2022/05/16 17:06:40 DirIsWritable duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 HasCommand duration: 3.4708ms, args: git.exe
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 error: HasParentFilePath
CreateFile C:\.git: The system cannot find the file specified.
2022/05/16 17:06:40 HasParentFilePath duration: 0s, args: .git
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 ExecutionTime duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 ErrorCode duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 Root duration: 0s, args:
2022/05/16 17:06:40 debug: Pwd
C:\Users\dio
2022/05/16 17:06:40 Pwd duration: 0s, args:
2022/05/16 17:06:40 debug: Home
C:\Users\dio
2022/05/16 17:06:40 GOOS duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 TemplateCache duration: 0s, args:
2022/05/16 17:06:40 Shell duration: 0s, args:
2022/05/16 17:06:40 debug: Getenv
C:\Users\dio\AppData\Local
2022/05/16 17:06:40 Getenv duration: 0s, args: LOCALAPPDATA
2022/05/16 17:06:40 CachePath duration: 0s, args:
2022/05/16 17:06:40 Flags duration: 0s, args:
@SamotoKuen SamotoKuen added the 🐛 bug Something isn't working label May 16, 2022
@JanDeDobbeleer
Copy link
Owner

@SamotoKuen that's a terminal responsibility and thus issue. For example, this is your theme in iTerm2:

image

On Hyper for example, only the battery icon is rendered incorrectly:

image

@SamotoKuen
Copy link
Author

@SamotoKuen that's a terminal responsibility and thus issue. For example, this is your theme in iTerm2:

image

On Hyper for example, only the battery icon is rendered incorrectly:

image

So do I need to change terminals to solve this problem?Basically all theme have same problem :(

@JanDeDobbeleer
Copy link
Owner

@SamotoKuen btw, the easiest fix is to add a space in your theme. That will render it correctly in your terminal, but obviously potentially wrong in another one.

@SamotoKuen
Copy link
Author

Thanks for anwser! It help me a lot.

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants