开发者

How to get Emacs to stop parsing shell output

I have a shell with lots of crap spewing and emacs trying to parse everything. I don't want to stop the command, but I'd like emacs to stop takin开发者_JAVA百科g all of my cpu. Is there a way I can tell emacs to just print stuff out and not try to match parenthesis and stuff?


I think commint-mode, a "base" mode of shell-mode, syntax/file/error highlighting is the culprit here. So you might look for ways to dumb down shell/comint-mode to just those faculties that allow interacting with the shell. Start by looking at C-h v shell-mode-hook and C-h v comint-mode-hook, in particular look for compilation-shell-minor-mode, ansi-color-for-comint-mode-on or any other minor modes which would involve a lot of examination of shell output.


I don't believe there is, so (as far as I know) you have only two options:

  • CTRL+c, CTRL+c to cancel the command
  • PageUp to get away from the scrolling

In my experience, moving your cursor position to above where the output scrolls will help somewhat. I'm not sure if it just saves emacs the effort of writing to the screen, or if it saves other effort as well, but like I said it does seem to help a bit.


I suspect that switching major modes would cause big problems, but you could try disabling all the minor modes for that buffer.


Doesn't answer the question directly, but you can run long commands to a separate buffer with shell-command (M-!). The "Shell Command Output" buffer will be in Fundamental mode.

I've started using this for commands whose output I know will be long, to prevent my shell buffer from getting bloated; the lack of incorrect syntax highlighting is another plus.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜