alacritty: Doesn't display italic font

OS: macOS 10.14.2

I’m using a Fantasque Sans patched by nerd fonts, and here is my alacritty config:

# Font configuration (changes require restart)
font:
  # Normal (roman) font face
  normal:
    family: FantasqueSansMono Nerd Font
    # The `style` can be specified to pick a specific face.
    style: Regular

  # Bold font face
  bold:
    family: FantasqueSansMono Nerd Font
    # The `style` can be specified to pick a specific face.
    style: Bold

  # Italic font face
  italic:
    family: FantasqueSansMono Nerd Font
    # The `style` can be specified to pick a specific face.
    style: Italic

In alacritty I can’t see any italic fonts (iTerm2 can display italic fonts correctly), and here are two screenshots of alacritty and iTerm2 opening a same file using vim:

Alacritty: Alacritty screenshot

iTerm2: iTerm2 screenshot

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 4
  • Comments: 46 (24 by maintainers)

Commits related to this issue

Most upvoted comments

In case anyone else is still having issues. In your config italic: should be italics:

If you are running tmux, try adding to your .tmux.conf

set -g default-terminal "alacritty"

you don’t, alacritty will request proper weight and slant for everything if you omit them, so having something like.

font:
  normal:
    family: MonoLisa Nerd Font

will work for you just fine.

it works after removing the style: * line in alacritty config.

CleanShot 2020-12-01 at 15 07 12

This solved the issue for me! Removing those lines fixed it.

If you are running tmux, try adding to your .tmux.conf

set -g default-terminal "alacritty"

This is working. But I’m afraid setting a TERM other than screen-256color/tmux-256color breaks other things.

it works after removing the style: * line in alacritty config.

CleanShot 2020-12-01 at 15 07 12

it’s not, it’s italic. https://github.com/alacritty/alacritty/blob/9028fb451a967d69a9e258a083ba64b052a9a5dd/alacritty.yml#L128 . And always was ‘italic’, providing italics, will make it ignore that section entirely, thus it’ll fallback to using your normal font family and setting slant for a font that corresponds to italic.

This seems to be a common issue for many terminal emulators. I found this workaround which adds sitm=\E[3m, ritm=\E[23m to a custom terminfo file. I had the same issue before and this worked for me. One thing worths notice is that you may need to set TERM back when you ssh to another machine (e.g. TERM=xterm-256color ssh host).

If you are running tmux, try adding to your .tmux.conf

set -g default-terminal "alacritty"

This is working. But I’m afraid setting a TERM other than screen-256color/tmux-256color breaks other things.

For anyone down this rabbit hole, this comment helped put everything into perspective.

There is also this guide that though a bit outdated provides some useful information as to why this process is so chaotic in macOS. The opening sentence:

macOS ships with an old and very out-of-date version of ncurses (5.7). This version does not contain a terminfo entry for tmux-256color, the preferred TERM value when using tmux.

The solution part of the guide is a bit outdated (does not apply to Apple Silicon), so if you want to fix it properly you might want to follow this instead.

@kchibisov Turned out the italic style for MonoLisa font is actually called Regular Italic instead of Italic, Alacritty finally works when I change style: Italic to style: Regular Italic in alacritty.yml`. Thanks for your reply.

Could you try running tic from a regular user?

I am experiencing this same issue, and there doesn’t appear to be a solution here. In Vim and Emacs, italics don’t appear in Alacritty.

  • Italics appear normally when using iTerm and Kitty
  • This occurs in every font I try, Victor Mono, Source Code Pro, Fira Code, Menlo
  • My config looks like this:
 font:
   normal:
     family: Victor Mono
     style: Regular
   bold:
     family: Victor Mono
     style: SemiBold
   italic:
     family: Victor Mono
     style: Italic
   bold_italic:
     family: Victor Mono
     style: SemiBold Italic
  • echo -e "\e[3mItalic" does output italic text
  • running TERM=xterm-256color before a command does not fix it
  • running XTERM_version=9999 TERM=xterm-256color before a command does not fix it
  • Same output from nvim -V3log, no enter_italics_mode appears in Alacritty
  • I’ve tried the hacky terminfo file “workaround” but it doesn’t work

Alacritty’s terminfo should already set these correctly, other terminfos are not supported. So I don’t think there’s any issue here left to fix.