Abort Printing of Huge Amounts of Text in Terminal

1

This has happened to me in a variety of instances:

  • Sometimes I accidentally copy/paste the wrong thing into vim, and then I have to wait around 10 minutes for it to print through all that text.
  • I would love the SQL extension of IPython, but because it doesn't seem to have a good way of returning large queries, again, I have to wait a long time after each query to go through all that text.

Surely, there has to be a way of interrupting that?

James Sydow

Posted 2014-08-09T14:47:45.967

Reputation: 63

Control-C? That interrupts terminal commands – Huey – 2014-08-09T16:07:55.030

Answers

2

Finally figured it out. CTRL + S pauses sending any more text to the tty -- at which point you can (usually) do a CTRL+C to send a SIGINT to the subprocess to stop it from printing.

That way, if you're in vim or IPython, you don't have to kill the process and can remain in your session.

Also, in the SqlMagic extension of IPython, you can prevent it from happening at all by setting SqlMagic.displaylimit.

James Sydow

Posted 2014-08-09T14:47:45.967

Reputation: 63