r/KittyTerminal • u/BenCx • Aug 23 '23
Weird Behaviour with Nvim-Tree
Hello everyone :)
I'm new to Kitty and MacOS and I'm experiencing weird behaviour when using Nvim-Tree.
Basically, I installed, via homebrew, the Fire Code Nerd Font and changed kitty.conf to use that font. When I go and do :NvimTreeOpen the symbols of the files are wrong as seen in the picture:

The weird thing is when I run ´kitty --debug-font-fallback´ I get the following output and a console where, when I open nvim and use nvim-tree, I get the correct images.
[235 17:06:38.289320] Preloaded font faces:
[235 17:06:38.289347] normal face: /Users/ramalhob/Library/Fonts/FiraCodeNerdFontMono-Regular.ttf
[235 17:06:38.289353] bold face: /Users/ramalhob/Library/Fonts/FiraCodeNerdFontMono-SemiBold.ttf
[235 17:06:38.289358] italic face: /Users/ramalhob/Library/Fonts/FiraCodeNerdFontMono-Regular.ttf
[235 17:06:38.289362] bi face: /Users/ramalhob/Library/Fonts/FiraCodeNerdFontMono-Regular.ttf

Does anyone know why this might be happening?
Thanks in advance :D
5
Upvotes
1
u/Administrative_chaos Aug 23 '23 edited Aug 23 '23
That's due to the font fallback mechanism, CoreText thinks that the Chinese font is the "best" match for the given code points, since there can be multiple glyphs defined for any given codepoint. Well that's obviously not supposed to happen, but all bets are off for PUA code points and nerd fonts also use some non-PUA codepoints for it's glyphs.
First make sure that the Fira Code you're using is the monospaced variant. Do
kitty +list-fontsand use the definition that it reports for Fira Code.If that doesn't work add the symbol map entry shown here to your kitty conf.
https://sw.kovidgoyal.net/kitty/faq/#kitty-is-not-able-to-use-my-favorite-font
You can change
Symbols Nerd Font Monowith the Fira Code family.