JanDeDobbeleer / oh-my-posh

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

Icons display incorrectly after update to 7.54.0 #2004

Closed sgiddings-kunzleigh closed 2 years ago

sgiddings-kunzleigh commented 2 years ago

Code of Conduct

What happened?

After updating my arrow icons in my prompt have been replaced with checkmarks. image

I expected after it updated to stay the same. image

Theme

I am using a custom theme. shaun-custom.omp.txt

What OS are you seeing the problem on?

macOS

Which shell are you using?

zsh, powershell

Log output

Version: 7.54.0

Segments:

ConsoleTitle(true)   -   0 ms - ~
os(true)             -   0 ms -    
shell(true)          -   0 ms -  pwsh 
time(true)           -   0 ms -  9:30:12 PM 
executiontime(true)  -   0 ms -  0ms 
git(false)           -   0 ms - 
terraform(true)      -  35 ms -  default 
az(false)            -   0 ms - 
aws(false)           -   0 ms - 
text(false)          -   0 ms -   
root(false)          -   0 ms - 
path(true)           -   0 ms -    
exit(true)           -   1 ms -   
exit(true)           -   0 ms -   
root(false)          -   0 ms - 
session(true)        -   0 ms -  shaun@S-GIDDINGS-L  

Run duration: 40.437777ms

Cache path: /Users/shaun/.cache/oh-my-posh

Logs:

2022/03/29 21:30:12 Flags duration: 189ns, args: 
2022/03/29 21:30:12 Flags duration: 405ns, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 5.599µs, args: OMP_CACHE_DISABLED
2022/03/29 21:30:12 Root duration: 984ns, args: 
2022/03/29 21:30:12 Shell duration: 88.742µs, args: 
2022/03/29 21:30:12 ErrorCode duration: 73ns, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.311µs, args: WSL_DISTRO_NAME
2022/03/29 21:30:12 IsWsl duration: 3.164µs, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 29.837µs, args: 
2022/03/29 21:30:12 PathSeparator duration: 75ns, args: 
2022/03/29 21:30:12 PathSeparator duration: 42ns, args: 
2022/03/29 21:30:12 User duration: 216ns, args: 
2022/03/29 21:30:12 Host duration: 6.941µs, args: 
2022/03/29 21:30:12 GOOS duration: 71ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 165.305µs, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.332µs, args: 
2022/03/29 21:30:12 GOOS duration: 44ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 187ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.428µs, args: 
2022/03/29 21:30:12 Shell duration: 82ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 151ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.586µs, args: 
2022/03/29 21:30:12 TemplateCache duration: 116ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 3.197µs, args: 
2022/03/29 21:30:12 ExecutionTime duration: 79ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 127ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.327µs, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.116µs, args: WSL_DISTRO_NAME
2022/03/29 21:30:12 IsWsl duration: 2.677µs, args: 
2022/03/29 21:30:12 GOOS duration: 61ns, args: 
2022/03/29 21:30:12 HasCommand duration: 24.736µs, args: git
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 915ns, args: 
2022/03/29 21:30:12 error: HasParentFilePath
stat /.git: no such file or directory
2022/03/29 21:30:12 HasParentFilePath duration: 14.465µs, args: .git
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.049µs, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 672ns, args: 
2022/03/29 21:30:12 HasFolder duration: 4.428µs, args: /Users/shaun/.terraform
2022/03/29 21:30:12 HasCommand duration: 13.031µs, args: terraform
2022/03/29 21:30:12 debug: RunCommand
default
2022/03/29 21:30:12 RunCommand duration: 34.78231ms, args: terraform workspace show
2022/03/29 21:30:12 TemplateCache duration: 275ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.626µs, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.221µs, args: AZURE_CONFIG_DIR
2022/03/29 21:30:12 FileContent duration: 131.543µs, args: /Users/shaun/.azure/azureProfile.json
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.675µs, args: AZURE_CONFIG_DIR
2022/03/29 21:30:12 FileContent duration: 89.209µs, args: /Users/shaun/.azure/AzureRmContext.json
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.524µs, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.151µs, args: AWS_VAULT
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 754ns, args: AWS_PROFILE
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 746ns, args: AWS_REGION
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 752ns, args: AWS_DEFAULT_REGION
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 740ns, args: AWS_CONFIG_FILE
2022/03/29 21:30:12 error: FileContent
open /Users/shaun/.aws/config: no such file or directory
2022/03/29 21:30:12 FileContent duration: 6.784µs, args: /Users/shaun/.aws/config
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 930ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 120ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.125µs, args: 
2022/03/29 21:30:12 Root duration: 803ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 805ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 627ns, args: 
2022/03/29 21:30:12 Flags duration: 71ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 630ns, args: 
2022/03/29 21:30:12 GOOS duration: 68ns, args: 
2022/03/29 21:30:12 GOOS duration: 41ns, args: 
2022/03/29 21:30:12 PathSeparator duration: 78ns, args: 
2022/03/29 21:30:12 PathSeparator duration: 41ns, args: 
2022/03/29 21:30:12 GOOS duration: 47ns, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 986ns, args: WSL_DISTRO_NAME
2022/03/29 21:30:12 IsWsl duration: 2.276µs, args: 
2022/03/29 21:30:12 StackCount duration: 79ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 238ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 13.151µs, args: 
2022/03/29 21:30:12 ErrorCode duration: 75ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 198ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 2.951µs, args: 
2022/03/29 21:30:12 ErrorCode duration: 71ns, args: 
2022/03/29 21:30:12 TemplateCache duration: 120ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 1.361µs, args: 
2022/03/29 21:30:12 Root duration: 824ns, args: 
2022/03/29 21:30:12 debug: Pwd
/Users/shaun
2022/03/29 21:30:12 Pwd duration: 886ns, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.008µs, args: SSH_CONNECTION
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 724ns, args: SSH_CLIENT
2022/03/29 21:30:12 TemplateCache duration: 139ns, args: 
2022/03/29 21:30:12 debug: Getenv

2022/03/29 21:30:12 Getenv duration: 1.808µs, args: XDG_CACHE_HOME
2022/03/29 21:30:12 CachePath duration: 19.616µs, args:
lewis-yeung commented 2 years ago

@sgiddings-kunzleigh The arrow icons (, aka \uf554) you expected are path-separators: (Line 126)

"folder_separator_icon": " \uf554 ",

When you are at your home directory, no path-separator will be printed.

Besides, you have duplicate "exit" segments in the config file you provided: (from Line 136 to 163)

{
  "alignment": "left",
  "newline": true,
  "segments": [
    {
      "properties": {
        "always_enabled": true
      },
      "style": "plain",
      "type": "exit"
    }
  ],
  "type": "prompt"
},
{
  "alignment": "left",
  "newline": true,
  "segments": [
    {
      "properties": {
        "always_enabled": true
      },
      "style": "plain",
      "type": "exit"
    }
  ],
  "type": "prompt"
},

Actually, the checkmark icons (, aka \uf42e) are exit status indicators, so from the debug log, we can see these:

exit(true)           -   1 ms - �[37m  �[0m
exit(true)           -   0 ms - �[37m  �[0m

So there is no bug and it's just fine to remove one duplicate "exit" segment. I have tested your config at my end and it works well.

sgiddings-kunzleigh commented 2 years ago

@lewis-yeung The arrows between directories is not what I am talking about. I am talking about, what I guess are lines more than arrows, that connected the working directory to the username on the prompt line. After the update they turned in to checkmarks. I have made no change to my JSON file for months.

sgiddings-kunzleigh commented 2 years ago

It looks like possibly when it updated, it changed my JSON file. I restored it from an older computer that still displayed correctly and it fixed everything.

shaun-custom-restore.omp.json.txt

JanDeDobbeleer commented 2 years ago

@sgiddings-kunzleigh thanks for the old config, I'll what's missing in the migration as that's what does this. We might have missed a use case.

lewis-yeung commented 2 years ago

@sgiddings-kunzleigh Oh sorry, now I got that what you expected is a "line connector" (I call it that way 😆). I have done another test on the auto migration using the first config file you provided, with template properties (got from the second config file) added under properties fields of the corresponding segments and it works well (on OMP v7.54.0). I have no idea whether this is caused by auto config migration or not.

JanDeDobbeleer commented 2 years ago

@sgiddings-kunzleigh so, the icon comes from the exit template. Do you want the prompt to indicate something on error? As it's not really configured to do that as I can see here.

sgiddings-kunzleigh commented 2 years ago

I don't. I just purely want this to be static, except the current time and command runtime of course.

If I have "hacked" together the join lines and I should be doing it a different way, I can change it. This is just what I got in there that works for me to display it properly. The lines are just there for visual flair, not to denote any statuses.

image

JanDeDobbeleer commented 2 years ago

@sgiddings-kunzleigh this is what you need. I think the text segment got wrongly migrated and the behaviour change in the exit segment now displays those icons because of that. Use this config and all will be well:

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "blocks": [
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "background": "#FEF5ED",
          "foreground": "#011627",
          "leading_diamond": "\ue0b2",
          "properties": {
            "centos": "\uf304",
            "debian": "\uf306",
            "elementary": "\uf309",
            "fedora": "\uf30a",
            "linux": "\uf17c ",
            "macos": "\uf179 ",
            "mint": "\uf30e",
            "opensuse": "\uf314",
            "raspbian": "\uf315",
            "ubuntu": "\uf31b ",
            "windows": "\ue62a ",
            "wsl": "WSL",
            "wsl_separator": " - "
          },
          "style": "diamond",
          "trailing_diamond": "<transparent,#FEF5ED>\ue0b2</>",
          "type": "os"
        },
        {
          "background": "#FEF5ED",
          "foreground": "#011627",
          "leading_diamond": "\ue0b2",
          "style": "diamond",
          "trailing_diamond": "<transparent,#FEF5ED>\ue0b2</>",
          "type": "shell"
        },
        {
          "background": "#516BEB",
          "foreground": "#ffffff",
          "leading_diamond": "\ue0b2",
          "properties": {
            "time_format": "3:04:05 PM"
          },
          "style": "diamond",
          "trailing_diamond": "<transparent,#516BEB>\ue0b2</>",
          "type": "time"
        },
        {
          "background": "#575656",
          "foreground": "#d6deeb",
          "leading_diamond": "\ue0b2",
          "properties": {
            "style": "roundrock",
            "threshold": 0
          },
          "style": "diamond",
          "trailing_diamond": "\ue0b0",
          "type": "executiontime"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [
        {
          "background": "#17D7A0",
          "foreground": "#011627",
          "leading_diamond": "\ue0b2",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": "\ue725 ",
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "fetch_worktree_count": true
          },
          "style": "powerline",
          "type": "git"
        },
        {
          "background": "#ebcc34",
          "foreground": "#000000",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "type": "terraform"
        },
        {
          "background": "#008AD7",
          "foreground": "#000000",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "type": "az"
        },
        {
          "background": "#FFA400",
          "foreground": "#ffffff",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "type": "aws"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "style": "plain",
          "template": "\u256d\u2500",
          "type": "text"
        },
        {
          "properties": {
            "root_icon": "\uf292 "
          },
          "style": "plain",
          "type": "root"
        },
        {
          "properties": {
            "folder_icon": "\uf07b ",
            "folder_separator_icon": " \uf554 ",
            "home_icon": "\uf7db ",
            "style": "agnoster_full"
          },
          "style": "plain",
          "type": "path"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "style": "plain",
          "template": "\u2570\u2500",
          "type": "text"
        },
        {
          "background": "#ffff66",
          "foreground": "#111111",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "root_icon": "\uf0e7"
          },
          "style": "powerline",
          "type": "root"
        },
        {
          "background": "#FEF5ED",
          "foreground": "#011627",
          "leading_diamond": "\ue0b2",
          "style": "diamond",
          "trailing_diamond": "\ue0b0 ",
          "type": "session"
        }
      ],
      "type": "prompt"
    }
  ],
  "console_title_template": "{{ .Folder }}",
  "osc99": true,
  "transient_prompt": {
    "background": "transparent",
    "foreground": "#ffffff",
    "template": "{{ .PWD }}> "
  },
  "version": 2
}
github-actions[bot] commented 8 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.