2

I was trying to figure out how Emacs renders so fast in the terminal, especially since I think it might have to redraw a large portion (or all the terminal) most of the time. But I haven't yet dug into the code, but I did compile v25 from source. If there's something specific to look for in the code I'd appreciate the pointer.

Does emacs use ncurses to render in the terminal? (If not, what does it use?)

lucidquiet
  • 229
  • 1
  • 7

1 Answers1

5

Emacs uses termcap to query for the terminal capabilities (such as what the control codes for positioning the cursor are) and implement something along ncurses with its own optimizations to redraw as little as possible. This might sound familar to you if you've ever queried for terminal capabilities with terminfo, a newer implementation of the same idea.

These days the termcap API is typically provided by ncurses, so don't expect Emacs to be necessarily linked with the termcap library.

wasamasa
  • 21,803
  • 1
  • 65
  • 97