kephale / emacs-eat

GNU General Public License v3.0
18 stars 0 forks source link

+title: Eat: Emulate A Terminal

Eat's name self-explainary, it stands for "Emulate A Terminal". Eat is a terminal emulator. It can run most (if not all) full-screen terminal programs, including Emacs.

It is pretty fast, more than three times faster than Term, despite being implemented entirely in Emacs Lisp. So fast that you can comfortably run Emacs inside Eat, or even use your Emacs as a terminal multiplexer.

It has many feature that other Emacs terminal emulator still don't have, for example complete mouse support.

It flickers less than other Emacs terminal emulator, so you get more performance and a smooth experience.

To start Eat, run =M-x eat=. Eat has three keybinding modes:

If you like Eshell, then there is a good news for you. Eat integrates with Eshell. Eat has two global minor modes for Eshell:

You can add any of these to ~eshell-first-time-mode-hook~ like the following:

+begin_src emacs-lisp

;; For `eat-eshell-visual-command-mode'. (add-hook 'eshell-first-time-mode-hook

'eat-eshell-visual-command-mode)

;; For `eat-eshell-mode'. (add-hook 'eshell-first-time-mode-hook #'eat-eshell-mode)

+end_src

Eat requires at Emacs 28.1 or above. Eat isn't available on any ELPA right now. So, you have to follow one of the following methods:

** Quelpa

+begin_src emacs-lisp

(quelpa (eat :fetcher git :url "https://codeberg.org/akib/emacs-iwindow.git" :files (".el" "dir" ".info" ".texi" ".ti" ("e" "e/*")))

+end_src

** Manual

Clone the repository and put it in your ~load-path~.

** Term

Term is the Emacs built-in terminal emulator. Its terminal emulation is pretty good too. But it's slow. It is so slow that Eat can beat native-compiled Term even without byte-compilation, and when Eat is byte-compiled, Eat is more than three times fast. Also, Term flickers, just try to run =emacs -nw= in it. It doesn't support remote connections, for example over Tramp. However, it has "line" mode, which Eat still doesn't have. If you want line mode in a terminal, or use an old version of Emacs, you can use Term, but Coterm + Shell is probably a better choice in case your Emacs version is 26.1 or above.

** Vterm

Vterm is powered by a C library, libvterm. For this reason, it can process huge amount of text quickly. It is about 1.5 times faster than Eat (byte-compiled or native-compiled) (and about 2.75 faster then Eat without byte-compilation). But it doesn't have a char mode (however you can make a char mode spending some effort). And it too flickers like Term, so despite being much faster that Eat, it seems to be slow. If you need your terminal to handle huge bursts (megabytes) of data, you should Vterm.

** Coterm + Shell

Coterm adds terminal emulation to Shell mode. Although the terminal Coterm emulates is same as Term, it is much faster, about three times, just a bit slow than Eat. However, it too flickers like other terminals. Since it's an upgrade to Shell, you get all the features of Shell like "line" mode, completion using your favorite completion UI (Company, Corfu, etc), etc. Most of these features are available in Eat-Eshell-Mode as Eshell is similar to Shell, however it's not Shell mode. Recommended if you like Shell.

This wouldn't have been possible if the following awesome softwares didn't exist: