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

Icons not rendering correctly #18343

Open
thesobercoder opened this issue Dec 20, 2024 · 3 comments
Open

Icons not rendering correctly #18343

thesobercoder opened this issue Dec 20, 2024 · 3 comments
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting

Comments

@thesobercoder
Copy link

Windows Terminal version

1.21.3231.0

Windows build number

10.0.26100.0

Other Software

Starship 1.21.1
Font: MonoLisa (a very capable font)

Steps to reproduce

  1. Install starship and add it your PowerShell profile.

  2. Create the $HOME\.config\starship.toml file with the content below.

    format = """
    [╭](fg:white)\
    $os\
    $directory\
    $git_branch\
    $git_status\
    $fill\
    $aws\
    $nodejs\
    $bun\
    $deno\
    $cmd_duration\
    $shell\
    $time\
    $username\
    $line_break\
    $character\
    """
    
    continuation_prompt = "[╰─[](fg:bold green)](fg:white)"
    command_timeout = 1000
    add_newline = true
    
    [character]
    format = """
    [│](fg:white)
    [╰─$symbol](fg:white) """
    success_symbol = '[](fg:bold green)'
    error_symbol = '[](fg:bold red)'
    
    [os]
    format = '(fg:black)[](fg:red)[$symbol ](fg:black bg:red)[](fg:red)'
    disabled = false
    
    [os.symbols]
    Alpine = ''
    Amazon = ''
    Android = ''
    Arch = ''
    CentOS = ''
    Debian = ''
    EndeavourOS = ''
    Fedora = ''
    FreeBSD = ''
    Garuda = ''
    Gentoo = ''
    Linux = ''
    Macos = ''
    Manjaro = ''
    Mariner = ''
    Mint = ''
    NetBSD = ''
    NixOS = ''
    OpenBSD = ''
    OpenCloudOS = ''
    openEuler = ''
    openSUSE = ''
    OracleLinux = '⊂⊃'
    Pop = ''
    Raspbian = ''
    Redhat = ''
    RedHatEnterprise = ''
    Solus = ''
    SUSE = ''
    Ubuntu = ''
    Unknown = ''
    Windows = ''
    
    [directory]
    format = '[─](fg:white)[](fg:blue)[󰷏 ](fg:black bg:blue)[](fg:blue bg:black)[ $path](fg:white bg:black)[](fg:black)'
    home_symbol = "~ "
    truncation_length = 1
    
    [git_branch]
    format = '[─](fg:white)[](fg:green)[$symbol ](fg:black bg:green)[](fg:green bg:black)[ $branch](fg:white bg:black)'
    symbol = ''
    truncation_length = 30
    
    [git_status]
    format = '[( $all_status)](fg:white bg:black)[](fg:black)'
    
    [nodejs]
    format = '[─](fg:white)[](fg:purple)[$symbol ](fg:black bg:purple)[](fg:purple bg:black)[ $version](fg:white bg:black)[](fg:black)'
    symbol = ''
    detect_files = ["package.json", ".node-version", "!bunfig.toml", "!bun.lockb"]
    
    [bun]
    format = '[─](fg:white)[](fg:purple)[$symbol ](fg:black bg:purple)[](fg:purple bg:black)[ $version](fg:white bg:black)[](fg:black)'
    symbol = ''
    
    [deno]
    format = '[─](fg:white)[](fg:purple)[$symbol ](fg:black bg:purple)[](fg:purple bg:black)[ $version](fg:white bg:black)[](fg:black)'
    symbol = ''
    
    [aws]
    format = '[─](fg:white)[](fg:blue)[$symbol ](fg:black bg:blue)[](fg:blue bg:black)[ $profile](fg:white bg:black)[](fg:black)'
    symbol = '󰸏'
    
    [fill]
    symbol = ''
    style = 'fg:white'
    
    [cmd_duration]
    min_time = 500
    format = '[─](fg:white)[](fg:178)[ ](fg:black bg:178)[](fg:178 bg:black)[ $duration ](fg:white bg:black)[](fg:black)'
    
    [shell]
    format = '[─](fg:white)[](fg:cyan)[ ](fg:black bg:cyan)[](fg:cyan bg:black)[ $indicator](fg:white bg:black)[](fg:black)'
    disabled = false
    
    [time]
    format = '[─](fg:white)[](fg:green)[󰦖 ](fg:black bg:green)[](fg:green bg:black)[ $time](fg:white bg:black)[](fg:black)'
    time_format = '%H:%M'
    disabled = false
    
    [username]
    format = '[─](fg:white)[](fg:yellow)[ ](fg:black bg:yellow)[](fg:yellow bg:black)[ $user](fg:white bg:black)[](fg:black) '
    show_always = true
  3. Apply the windows terminal settings below.

    {
      "$help": "https://aka.ms/terminal-documentation",
      "$schema": "https://aka.ms/terminal-profiles-schema",
      "actions": [
        {
          "command": {
            "action": "copy",
            "singleLine": false
          },
          "id": "User.copy.644BA8F2",
          "keys": "ctrl+c"
        },
        {
          "command": "paste",
          "id": "User.paste",
          "keys": "ctrl+v"
        },
        {
          "command": "find",
          "id": "User.find",
          "keys": "ctrl+shift+f"
        },
        {
          "command": {
            "action": "splitPane",
            "split": "auto",
            "splitMode": "duplicate"
          },
          "id": "User.splitPane.A6751878",
          "keys": "alt+shift+d"
        }
      ],
      "copyFormatting": "none",
      "copyOnSelect": false,
      "defaultProfile": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
      "newTabMenu": [
        {
          "type": "remainingProfiles"
        }
      ],
      "profiles": {
        "defaults": {
          "colorScheme": "nightfox",
          "cursorShape": "filledBox",
          "font": {
            "face": "MonoLisa",
            "features": {
              "calt": 1,
              "liga": 1,
              "ss02": 1,
              "ss07": 1,
              "ss08": 1,
              "ss09": 1,
              "ss13": 1,
              "ss14": 1,
              "zero": 1
            },
            "size": 14
          }
        },
        "list": [
          {
            "commandline": "%SystemRoot%\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoLogo",
            "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
            "hidden": false,
            "name": "Windows PowerShell",
            "startingDirectory": "%USERPROFILE%",
            "tabColor": "#81b29a"
          },
          {
            "commandline": "%USERPROFILE%\\.scoop\\apps\\git\\current\\usr\\bin\\zsh.exe -l",
            "guid": "{98d80d70-04d8-4bca-8ab7-10baf8985392}",
            "hidden": false,
            "name": "Zsh",
            "startingDirectory": "%USERPROFILE%",
            "tabColor": "#9d79d6"
          },
          {
            "commandline": "%SystemRoot%\\System32\\cmd.exe",
            "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
            "hidden": false,
            "name": "Command Prompt",
            "startingDirectory": "%USERPROFILE%",
            "tabColor": "#dbc074"
          }
        ]
      },
      "schemes": [
        {
          "background": "#192330",
          "black": "#393B44",
          "blue": "#719CD6",
          "brightBlack": "#575860",
          "brightBlue": "#86ABDC",
          "brightCyan": "#7AD5D6",
          "brightGreen": "#8EBAA4",
          "brightPurple": "#BAA1E2",
          "brightRed": "#D16983",
          "brightWhite": "#E4E4E5",
          "brightYellow": "#E0C989",
          "cursorColor": "#CDCECF",
          "cyan": "#63CDCF",
          "foreground": "#CDCECF",
          "green": "#81B29A",
          "name": "nightfox",
          "purple": "#9D79D6",
          "red": "#C94F6D",
          "selectionBackground": "#2B3B51",
          "white": "#DFDFE0",
          "yellow": "#DBC074"
        }
      ],
      "themes": []
    }
  4. Now open Windows Terminal with the PowerShell profile.

Expected Behavior

Windows Terminal should render icons like as shown in this screenshot from WezTerm.

Image

Actual Behavior

Windows Terminal doesn't render the icon properly as seen in this screenshot.

Image

@thesobercoder thesobercoder added Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting labels Dec 20, 2024
@lhecker
Copy link
Member

lhecker commented Dec 20, 2024

Usually this happens when your chosen font doesn't actually have the necessary Nerd Font glyphs.

Most of the team (including myself) are currently on the way out for some vacation, so it may take a while to come back to your issue. In the meantime, I'd recommend to double- & triple-check that you're definitely using a Mono Lisa variant with Nerd Font glyphs. I can't download or use Mona Lisa since it's not publicly available, but its website only advertises "Symbols and & Powerline", which may not be the same as Nerd Fonts (which is what you're trying to use).

FWIW you can specify multiple fonts nowadays by separating them with a comma (just like with CSS). That way you can specify another font that has Nerd Font glyphs as a fallback. That's not as good as using a font that has them to begin with though of course (because the metrics may be different).

@thesobercoder
Copy link
Author

@lhecker Thanks for your reply. In the starship configuration, I used standard emojis, which I'm guessing from your reply is not something Windows Terminal can render. Instead, I have to provide font glyphs and use a nerd font that has those glyphs? Please let me know if my understanding is correct.

@thesobercoder
Copy link
Author

@lhecker Thanks for your help. I patched the MonoLisa font with Nerd font and it works as expected. You can close this issue. Thanks again and happy holidays!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting
Projects
None yet
Development

No branches or pull requests

2 participants