---
id: fonts
title: Fonts
sidebar_label: Fonts
---

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

## Nerd Fonts

Oh My Posh was designed to use [Nerd Fonts][nerdfonts]. Nerd Fonts are popular fonts that are patched to include icons.
To see the icons displayed in Oh My Posh, **install** a [Nerd Font][nerdfonts], and **configure** your terminal to use it.

:::info
Fonts need to be installed on the host system as this is a UI setting, not a command line, or shell configuration.
This means **when running inside a container or WSL**, you need to install the font on the host system and configure
your terminal emulator to use it.
:::

## Installation

<Tabs
    defaultValue="oh-my-posh"
    values={[
        { label: 'Oh My Posh', value: 'oh-my-posh' },
        { label: 'Homebrew', value: 'homebrew' },
        { label: 'PowerShell', value: 'powershell' }
    ]
}>
<TabItem value="oh-my-posh">

Oh My Posh has a CLI to install a [Nerd Font][nerdfonts]:

:::info
When running as root/administrator, the fonts will be installed system-wide.
When running as a regular user, the fonts will be installed in the user's font directory.
By default, Oh My Posh installs the `.ttf` version of the font in case multiple versions are available.
:::

```bash
oh-my-posh font install meslo
```

We recommend `Meslo`, which includes the `Meslo LGM NF` font. To see every font you can install:

```bash
oh-my-posh font list
```

That prints one name per line, so you can search it:

```bash
oh-my-posh font list | grep -i mono
```

You can also install straight from a URL or a local zip file:

```bash
oh-my-posh font install https://example.com/font.zip
oh-my-posh font install ./CascadiaCode.zip
```

</TabItem>
<TabItem value="homebrew">

If you're using Homebrew, you can search for and install Nerd Fonts directly:

```bash
brew search nerd-font

brew install --cask font-fira-code-nerd-font
```

</TabItem>
<TabItem value="powershell">

If you're using PowerShell, you can use the [NerdFonts][nerdfonts-ps] module to install Nerd Fonts:

```powershell
Install-PSResource -Name NerdFonts
Import-Module -Name NerdFonts

Install-NerdFont -Name FiraCode   # Tab completion works on name
```

To install for all users, elevated permissions are required:

```powershell
Install-NerdFont -Name FiraCode -Scope AllUsers
```

</TabItem>
</Tabs>

## Configuration

Make sure to **configure your terminal** to use the font you have installed. The following sections will show you how to do this for the most popular terminals.

<Tabs
    defaultValue="wt"
    values={[
        { label: 'Windows Terminal', value: 'wt' },
        { label: 'Visual Studio Code', value: 'code' },
        { label: 'Visual Studio', value: 'vs' },
        { label: 'Apple Terminal', value: 'apple' }
    ]
}>
<TabItem value="wt">

Once you have installed a Nerd Font, you will need to configure the Windows Terminal to use it. This can be easily done
by modifying the Windows Terminal settings (default shortcut: `CTRL + SHIFT + ,`). In your `settings.json` file, add the
`font.face` attribute under the `defaults` attribute in `profiles`:

```json
{
    "profiles":
    {
        "defaults":
        {
            "font":
            {
                "face": "MesloLGM Nerd Font"
            }
        }
    }
}
```

</TabItem>
<TabItem value="code">

When using Visual Studio Code, you will need to configure the integrated Terminal to make use of the Nerd Font as well. This can be done by changing the `Integrated: Font Family` value in the Terminal settings (default shortcut: `CTRL + ,` and search for `Integrated: Font Family` or via `Users` -> `Features` -> `Terminal`).

If you are using the JSON based settings, you will need to update the `terminal.integrated.fontFamily` value. Example in case of `MesloLGM Nerd Font` Nerd Font:

```json
"terminal.integrated.fontFamily": "MesloLGM Nerd Font"
```

</TabItem>
<TabItem value="vs">

When using Visual Studio, you will need to configure the integrated Terminal to make use of the Nerd Font as well. This can be done by opening the settings
in `Tools > Options > Environment > Fonts and Colors > Terminal` and selecting a font like `MesloLGM Nerd Font`.

:::warning
OTF fonts do not appear in Visual Studio's Terminal settings, only TTF fonts. See [here][vs-otf] for more information.
:::

</TabItem>
<TabItem value="apple">

When using Apple Terminal, you will need to configure the settings based on the profile you are using. This can be done by opening the settings in `Profiles > Select the appropriate profile from the left panel > Text > Font` and select a font like `MesloLGM Nerd Font`.

This can also be configured via a terminal command. Example in case of `MesloLGM Nerd Font Mono` Nerd Font on the Basic profile for Apple Terminal:

```bash
osascript -e 'tell application "Terminal" to set font of settings set "Basic" to "MesloLGL Nerd Font Mono"'
```
:::warning
The command has only been tested on macOS Sequoia 15.5 24F74.
:::
</TabItem>
</Tabs>

## Other Fonts

If you are not interested in using a Nerd Font, you will want to use a theme which doesn't include any Nerd Font icons.
The `minimal` themes do not make use of Nerd Font icons.

[Creating your own theme][configuration] is always an option too 😊

## Referencing glyphs in your config

[Templates][templates] reference Nerd Font glyphs using Unicode escape sequences. Glyphs with code points up to
U+FFFF use the standard `\uXXXX` (4 hex digits) form, which works in all config formats.

Glyphs above U+FFFF (supplementary characters) require a format-specific escape:

| Escape form | JSON | YAML | TOML |
|---|---|---|---|
| `\uDB82\uDFC9` (surrogate pair) | ✅ | ❌ | ❌ |
| `\U000F0BC9` (8-digit `\U`) | ❌ | ✅ | ✅ |
| literal glyph | ✅ | ✅ | ✅ |

JSON combines a surrogate pair like `\uDB82\uDFC9` into the single code point U+F0BC9. YAML and TOML reject
surrogate pairs; use the 8-digit `\U` form instead. To avoid format-specific escapes altogether, embed the
literal character directly.

:::tip
[FileFormat.info][fileformat] lists every representation for a given glyph.
:::

[nerdfonts]: https://www.nerdfonts.com/
[nerdfonts-ps]: https://psmodule.io/NerdFonts
[configuration]: /docs/installation/customize
[vs-otf]: https://stackoverflow.com/questions/75252606/is-it-possible-to-use-nerd-fonts-as-the-font-for-terminals-in-visual-studio
[templates]: /docs/configuration/templates
[fileformat]: https://www.fileformat.info/info/unicode/char/F0BC9/index.htm
