Emacs

30 Oct 2021 - 17 Jun 2026
Open in Logseq
    • 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 term or M-x ansi-term instead of M-x shell or M-x eshell.
        • ansi-term is generally the better choice — it runs a full terminal emulator (VT100/ANSI) inside Emacs, so programs like htop, vim, ncurses apps, etc. work correctly.
        • term is 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-term still has issues (it can), vterm is the gold standard. It's a proper terminal emulator via a compiled C module:
        • Install: M-x package-install RET vterm RET (requires libvterm on your system)
        • Run: M-x vterm
        • vterm handles complex TUIs (e.g., ranger, lazygit, fzf) much better than ansi-term.