Do commands run considerably slower in the emacs shell? How can I prevent this but still use it? Do commands run considerably slower in the emacs shell? How can I prevent this but still use it? unix unix

Do commands run considerably slower in the emacs shell? How can I prevent this but still use it?


Emacs is capturing the final output in the shell buffer, and applying font-lock and other analysis (line number counting, for example) to display it. It also scrolls the display to show the latest output. While Emacs has provisions for culling pathologically long command output, it's not really optimized for truly huge quantities of output counting in millions of lines, so it performs visibly worse than your terminal emulator, slowing down the whole pipeline.

If you're not interested in the output, redirect it to /dev/null or to tail -500, which is how much you'd see of it in a typical terminal scrollback anyway.


no, emacs does not implement those tools. that is running the same tools you run from the command line. however, the output is being passed through various pipes and probably has various formatting applied by emacs, which is most likely the culprit for the extreme slowdown. one easy thing to try would be disabling font-lock mode in the shell buffer.


You don't say whether you use eshell or shell. In my experience, shell works just fine, but eshell is completely unusable for anything that wants to put >1k lines through a pipe (which is sad, because the other features of eshell look quite nice).

Note eshell is slow even if output is just one line, as long as you use a |, so it seems to be the actual | operator (that's implemented in emacs-lisp in eshell) that's being slow.