That Time Doom-Modeline Spoke Chinese to Me

That Time Doom-Modeline Spoke Chinese to Me
Screenshot by me of the Chinese character caused by doom-modeline.

Your Modeline Isn’t Multilingual, It’s Just Missing a Font

The first time I turned on doom-modeline in Emacs, I was greeted by something I wasn’t expecting: a single Chinese character sitting smugly in my modeline, right where my major mode icon should have been.

Was my editor trying to teach me a new language? Was this some deep cultural Easter egg hidden in Emacs? Or had I simply summoned the wrong demon by installing too many packages in a single evening?

As it turns out, the answer was much simpler: Emacs wasn’t speaking Chinese at all. It was falling back.


What Doom Modeline Actually Does (and Why You Need It)

If you’re new to Emacs, the modeline is the strip of information that sits at the bottom of your window. Think of it as Emacs’ dashboard: it tells you what file you’re in, which mode you’re using, whether you’ve unsaved changes, and more. Out of the box, Emacs gives you a perfectly functional—but let’s be honest—visually uninspired line of text.

That’s where Doom Modeline comes in. It’s a polished, modern replacement for the default modeline, inspired by the aesthetics of Doom Emacs. Instead of a gray soup of status indicators, Doom Modeline gives you:

  • Icons for file types and modes (so you don’t need to parse raw text)
  • Git status indicators (branch, staged/unstaged changes, etc.) right in your modeline
  • System stats like CPU, memory usage, and battery life
  • Better visual hierarchy so the important stuff is easy to spot
  • Customizable modules, meaning you can decide what matters for your workflow

In short: Doom Modeline takes the boring old dashboard and turns it into a sleek heads-up display. Once you’ve used it, going back feels like swapping your Tesla’s touchscreen for a 1980s cassette deck.


The Mystery Glyph

Here’s the trick: doom-modeline likes to decorate your modeline with shiny icons for buffer states, Git branches, and your current major mode. Those icons come from Nerd Icons, which in turn need a specific font: Symbols Nerd Font.

If you don’t have that font installed, Emacs shrugs and asks your system to display “something, anything” for the glyph. Your system, being unhelpfully clever, picks a character from a CJK font. Congratulations, your Lisp Interaction icon is now a stray Hanzi.


Step 1: Install the Correct Font

On macOS:

brew tap homebrew/cask-fonts
brew install --cask font-symbols-only-nerd-font

On Linux (Ubuntu/Debian):

sudo apt install fonts-nerd-fonts-symbols-mono

Or, if your distro is less accommodating:

wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.1.1/Symbols-Only.tar.xz
tar -xf Symbols-Only.tar.xz
mkdir -p ~/.local/share/fonts
cp *.ttf ~/.local/share/fonts/
fc-cache -fv

On Windows: download the release zip, right-click the .ttf files, and select Install for all users.

Now, when Emacs asks for that symbol, your system won’t panic and reach for Chinese.


Step 2: Tell Emacs About It

Inside your config, make doom-modeline aware of the font:

;; Icons backend (doom-modeline uses nerd-icons now)
(use-package nerd-icons
  :ensure t
  :if (display-graphic-p))

(use-package doom-modeline
  :ensure t
  :hook (after-init . doom-modeline-mode)
  :custom
  (doom-modeline-height 28)
  :config
  (let ((font "Symbols Nerd Font Mono"))
    (if (member font (font-family-list))
        (progn
          (setq doom-modeline-icon t
                doom-modeline-major-mode-icon t
                nerd-icons-font-family font)
          (set-fontset-font t 'symbol (font-spec :family font) nil 'prepend)
          (set-fontset-font t '(#xE000 . #xF8FF)
                            (font-spec :family font) nil 'prepend)
          (message "doom-modeline: using Nerd Font icons."))
      (setq doom-modeline-icon nil
            doom-modeline-major-mode-icon nil)
      (message "doom-modeline: Nerd Font not found, icons disabled."))))

Step 3: Graceful Degradation

Notice the if. This is the part that saves you from embarrassment when you clone your config onto a colleague’s machine.

  • If the font is installed → icons appear.
  • If not → doom-modeline quietly turns off icons and shows plain text.

No more mysterious glyphs. No more “why is Emacs Japanese today?” questions. Just a clean modeline, icons optional.


The Takeaway

What looks like a random bug often has a simple explanation. Emacs wasn’t trying to teach me Chinese — it was just desperately picking a fallback font. By installing the right Nerd Font and teaching Emacs how to use it, the problem disappears.

And the nice part is: if someone doesn’t install the font, my config won’t punish them with hieroglyphics. They’ll just get a straightforward, text-only modeline.

Doom-modeline isn’t bilingual after all. It just needed a proper typeface.