wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
17.82k stars 798 forks source link

how to use icons-in-terminal font instead of nerd-fonts? #3349

Open bersace opened 1 year ago

bersace commented 1 year ago

Is your feature request related to a problem? Please describe. Nerd fonts is awesome but lake some product logo. Like git logo and a lot of file format icons. icons-in-terminal sizes are better fitted for terminal. icons-in-terminal is designed as a fallback font instead of font patch.

Describe alternatives you've considered As of now, I'm using WezTerm default, Nerd Fonts with the following configuration:

Additional context

I maintain https://gitlab.com/bersace/powerline.bash which prefers icons-in-terminal rather than nerd-fonts.

Doom Emacs uses icons-in-terminal.

See https://github.com/sebastiencs/icons-in-terminal/.

Thanks for wezterm. It's awesome.

wez commented 1 year ago

The config you wanted to share doesn't show up here, could you update to (re-)add it?

bersace commented 1 year ago

Sorry, here it is:

config.font = wezterm.font_with_fallback {
  'JetBrains Mono',
  'icons-in-terminal',
  'Material Icons',
}
wez commented 1 year ago

Do the codepoints collide with those in nerd-fonts? If so: I don't think there is a great way to seamlessly swap the font by default without breaking many users on upgrade.

I just noticed that that project hasn't been updated in 6 years, and it doesn't seem like the maintainer is active in responding to users.

Sorry to say that I don't think this is a great candidate to ship as a default in wezterm.

bersace commented 1 year ago

@wez thanks for looking at this. I didnt thought of shipping icons-in-terminal. The title of the issue is misleading. I meaned Allow users to use icons-in-terminal. Would it be possible to disable nerd-font embedded fallback ?

wez commented 1 year ago

Ah, I see. There's no need to prevent it; when you use font_with_fallback the way you pasted above, the fonts are tried in the order you specify, before the default fallbacks are added, so your icons-in-terminal will take precedence.

bersace commented 1 year ago

That's what I thought. Here is the output for the git logo:

image

instead of (Tilix)

image

echo $'\uEDCE '
bersace commented 1 year ago

Sorry, I forgot to reload the shell. The issue I have with icons in terminal is the size of icons:

image

wez commented 1 year ago

Options that may help:

bersace commented 1 year ago

Thanks @wez for the pointers. These icons are actually followed by spaces. Setting allow_square_glyphs_to_overflow_width to Always does not change anything. Changing scale moves slightly the icons up or down without changing the width of the icons.

image