Search This Blog

Sunday, January 31, 2021

Pause Resume Terminal Output

Suppose there is a stream of output being printed in the terminal and you want to pause it to read or to capture the screenshot you can try 𝐂𝐭𝐫𝐥 + 𝐒 (XOFF control command) to freeze the output it can be resumed by 𝐂𝐭𝐫𝐥 + 𝐐 (XON Control Command)

Switching Linux XON/OFF Flow Control:

  • To enable: 𝐬𝐭𝐭𝐲 𝐢𝐱𝐨𝐧
  • To disable: 𝐬𝐭𝐭𝐲 -𝐢𝐱𝐨𝐧

"Long before there were computers, there were teleprinters (a.k.a. teletypewriters, a.k.a. teletypes). Think of them as roughly the same technology as a telegraph, but with some type of keyboard and some type of printer attached to them.

Because teletypes already existed when computers were first being built, and because computers at the time were room-sized, teletypes became a convenient user interface to the first computers – type in a command, hit the send button, wait for a while, and the output of the command is printed to a sheet of paper in front of you.

Software flow control originated around this era – if the printer couldn't print as fast as the teletype was receiving data, for instance, the teletype could send an XOFF flow control command (Ctrl+S) to the remote side saying "Stop transmitting for now", and then could send the XON flow control command (Ctrl+Q) to the remote side saying "I've caught up, please continue".

And this usage survives in Unix because modern terminal emulators are emulating physical terminals (like the vt100) which themselves were (in some ways) emulating teletypes."