You don't need a terminal emulator · Andrey Listopadov
andreyor.st
andreyor.st
The article would make more sense if the author said 'you may not need an interactive shell. Here's how to use a pseudo-terminal-emulation mode in Emacs to launch commands without using a shell.'
Hence why I said async-shell-command isn't technically a terminal emulator. It does, however, provide the same functional capability to launch a program, direct user input to it, and receive output from the program -- what most people are using terminal emulators for.
The big difference, in the authors described workflow, is they are launching these commands on an ad-hoc basis, not from a semi-permanent shell. That, I would argue, is the biggest practical difference between what most people are doing and what the author is describing.
That being said the whole point of the thing is not avoiding the interactive shell either, is the fact that ANSI escape terminal emulators are in fact "too advanced" and "too interactive" and you might not want that.
Those terminals execute pretty high level operations with the display in a complex in-band mechanism.
What I like about the emacs buffer approach is that it approximates the IBM 3270 handling of terminals; still online and interactive, still can refresh screen every keypress "if you really really want", but the expected approach to interactivity is receiving and submitting a-whole-screen/a-whole-form of information at once.
I've got a CPU doing billions and billions cycles per second and a badass monitor. I want my prompt to feel instantaneous.
And although I'm a big Emacs user and although Emacs is nowadays one of the fastest editor [1] out there (compared to IDEs like VS Code / IntelliJ or any Electron app), I don't feel like any of ansi-term / eshell / libvterm solution feels low latency / no input lag.
That's why although you can pry Emacs from my cold dead hands, I still use terminal emulators outside of Emacs.
I'd say 99.9% of the reason to use a terminal inside Emacs is anyway to cut/paste content from the buffer to Emacs: for that I use a shell script which pipes the output of my command into a new Emacs buffer.
[1] Time it takes to launch Emacs, execute Emacs Lisp code, and exit:
$ time emacs -Q -nw -eval '(kill-emacs)'
real 0m0.049s
49 ms.- and overall embedding random things like Sixel and tektronics graphic terminal emulation, and correctly handling Unicode and bidi, and supposedly having garbage stdout rendering speed - but I believe if you're dumping several million screenfulls of scrolling text you're holding your terminal wrong.
It shouldn't be a surprise, given its relationship with Lisp based computers, and Emacs inspired IDEs in Lisp Machines, with integrated REPL.
Unless the shell exposes the whole OS stack like Fish or Powershell, a REPL is much more powerful.
Why do you think that a subjective assessment of some lag automatically disqualifies a terminal emulator from being "suitable for serious work"?
I mean, what's this "serious work" that you do that is sabotaged by a few milliseconds of lag?
For me, the ultimate dev setup is really tmux plus vim (and other command line tools).
> You don't need a terminal! Look at all the stuff I do without one...
[...]
> Oh, but, yeah, I totally use eshell + EAT.
> Why do you need a terminal?