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:
iTerm2:
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 4
- Comments: 46 (24 by maintainers)
Commits related to this issue
- feat(alacritty): remove `italics` section Reference: https://github.com/alacritty/alacritty/issues/1977#issuecomment-720702666 — committed to abeidahmed/dotfiles by abeidahmed a year ago
In case anyone else is still having issues. In your config
italic:
should beitalics:
If you are running tmux, try adding to your .tmux.conf
you don’t, alacritty will request proper weight and slant for everything if you omit them, so having something like.
will work for you just fine.
This solved the issue for me! Removing those lines fixed it.
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.it’s not, it’s
italic
. https://github.com/alacritty/alacritty/blob/9028fb451a967d69a9e258a083ba64b052a9a5dd/alacritty.yml#L128 . And always was ‘italic’, providingitalics
, 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 setTERM
back when youssh
to another machine (e.g.TERM=xterm-256color ssh host
).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:
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 ofItalic
, Alacritty finally works when I changestyle: Italic
tostyle: 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.
echo -e "\e[3mItalic"
does output italic textTERM=xterm-256color
before a command does not fix itXTERM_version=9999 TERM=xterm-256color
before a command does not fix itnvim -V3log
, noenter_italics_mode
appears in AlacrittyAlacritty’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.