3 ms·
Also: Emacs has shell windows, process management, and output filtering, and keyboard macros, so it can run and control and respond to sub-processes (kind of li
by DonHopkins 7y ago
Also: Emacs has shell windows, process management, and output filtering, and keyboard macros, so it can run and control and respond to sub-processes (kind of like "expect" on steroids).
I could not give up running shells in an emacs shell window, capturing all the output as normal text I can edit and search with the full power of emacs, instead of a dumb scrolling terminal emulator, and the ability to make keyboard macros that hop between text files and dired directory listings and shell windows, copying file names and data to fire off sequences of shell commands. Easy on-the-fly automation of repetitive tasks. Why write a single use shell script when you can just do it once by hand while recording a keyboard macro, then repeat it thousands of times.
- pmoriarty 7y agoSo what do you do when some shell command you run chooses to spit out a bunch of really long lines? Emacs would freeze on me when this happens. Is there a way around this apart from running a shell under libvterm? Or is this even still an issue under libvterm too?
- alexhutcheson 7y agoNot OP, but that hasn't come up for me very often. If a command output is really long or takes a long time to run I'll normally run it using M-& (async-shell-command) instead of running it in a shell buffer. Long lines are a more general issue with Emacs, but there's changes in Emacs 27 that should mostly solve it.
- pmoriarty 7y ago"that hasn't come up for me very often" The fact that it can happen and does happen leads me to avoid Emacs' shell modes altogether. I just don't want my Emacs freezing on me ever. Considering how much I do in it, it freezing on me is an utter and complete disaster that I want to completely avoid even if it doesn't happen often. "there's changes in Emacs 27 that should mostly solve it" If you're talking about the solong mode integration, that's just a hack that kind of works for static buffers, but won't help in dynamic buffers like shell-mode. To really and truly fix this issue, a core part of Emacs will have to be rewritten, and since that part is written in C and is pretty hairy, no one seems to want to deal with it. So it probably won't happen any time soon. I'm just hoping Emacs' libvterm integration provides a good workaround, at least for using a shell from within Emacs. I'll have to give it a try one of these days.