Emacs
30 Oct 2021 - 17 Jun 2026
- why are my doc files not in here, but in random org files?
- How do I get in emacs a shell with a terminal that works with fancy TUIs?
- Ask Claude
- Use
M-x termorM-x ansi-terminstead ofM-x shellorM-x eshell.
ansi-termis generally the better choice — it runs a full terminal emulator (VT100/ANSI) inside Emacs, so programs likehtop,vim,ncursesapps, etc. work correctly.
termis similar but slightly more limited.
Key bindings in
ansi-term:
C-c C-j— switch to "line mode" (lets you use normal Emacs editing)
C-c C-k— switch back to "char mode" (sends keystrokes directly to the terminal)
- You need to be in char mode for TUIs to work properly.
Alternative:
vterm
- If
ansi-termstill has issues (it can),vtermis the gold standard. It's a proper terminal emulator via a compiled C module:
- Install:
M-x package-install RET vterm RET(requireslibvtermon your system)
- Run:
M-x vterm
vtermhandles complex TUIs (e.g.,ranger,lazygit,fzf) much better thanansi-term.
- Use