guidoism
guidoism

Reputation: 8158

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 taking 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?

Upvotes: 4

Views: 640

Answers (4)

harpo
harpo

Reputation: 43168

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.

Upvotes: 1

Ross Patterson
Ross Patterson

Reputation: 5742

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.

Upvotes: 2

phils
phils

Reputation: 73246

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

Upvotes: 1

machineghost
machineghost

Reputation: 35750

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.

Upvotes: 1

Related Questions