Skip to Content
glyphs

🐚 zsh

Load glyphs as ICON_* variables, or re-prefix the published files for your own namespace.

Nerd Font glyphs need a Nerd Font in your terminal. Without one they render as a box.

The plugin

glyphs.plugin.zsh sources zsh/nerd.zsh, which defines an ICON_* variable per glyph. No Node is involved.

# antidote, in ~/.zsh_plugins.txt
kud/glyphs

# zinit
zinit light kud/glyphs

For oh-my-zsh, clone the repo into $ZSH_CUSTOM/plugins/glyphs and add glyphs to plugins=().

print -P "$ICON_CHECK done"
echo "$ICON_ARROW_RIGHT next"

Variable names are the glyph name in upper snake case: arrow-right becomes ICON_ARROW_RIGHT.

Per-variant files

Each variant is published as a plain file under zsh/:

FileContents
zsh/nerd.zshEvery glyph, Nerd Font codepoints
zsh/emoji.zshEvery glyph, emoji (empty where a glyph has none)
zsh/unicode.zshOnly the glyphs that have a plain-Unicode fallback

Values look like ICON_CHECK=$'\U0000F00C': normalised eight-digit escapes, never raw bytes.

A custom prefix, without Node

Re-prefix a file with sed. Anchoring on ^ICON_ swaps the variable name and leaves the escaped payload alone.

curl -fsSL https://raw.githubusercontent.com/kud/glyphs/v0.4.0/zsh/nerd.zsh \
  | sed 's/^ICON_/SHUI_ICON_/' > icons.zsh

source icons.zsh
# SHUI_ICON_CHECK=$'\U0000F00C'

Pin the tag you want in the URL. This is how shui builds its icon sets: a re-prefix run only when it bumps this package, then plain literal files sourced at runtime.

From JavaScript, renderZsh({ prefix }) does the same job; see the TypeScript API.