<div style="font-family: Arial, sans-serif; font-size: 14px;">G'day all,</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Sharing a revelation that I had today, that might sound obvious to long time linux users.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I am by no means a linux newbie, but nevertheless, I am always learning something new about GNU/Linux.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I am a primarily terminal user and I have always used terminal multiplexer like GNU-screen and tmux.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Occasionally, I would use the "copy mode" of the multiplexer to "freeze" the screen to copy a few stuff. And the string I want to copy can be a long JSON string that line wraps in my terminal.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Now if you use a mouse to highlight and copy this long string while in the multiplexer's "copy mode", the line wraps translates to a "new line" (\n) character.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">So occasionally, I would use Ctrl+S to maintain the line wrap of this long string to copy, then continue with Ctrl+Q when I am done.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Here's the part that I never noticed and surprised me today: bash actually "freezes" the process while in this mode provided if the process writes to <code>/dev/stdout</code>​.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I did a few tests with some simple for-loop in bash:</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><code>$ for i in {1..20}; do date >> /tmp/foo.log; sleep 1; done # Does not freeze the process with ctrl+s</code><span></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Whereas</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><code>$ for i in {1..20}; do date >> /tmp/foo.log; date; sleep 1; done # Freezes the process with ctrl+s</code>​<span></span></div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I guess this only came as a surprise because I am so used to terminal multiplexer "copy mode" where the process continues to produce output while in this mode and you are fast-forwarded after you exited "copy mode".</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">I haven't really bothered to find out the history of this Ctrl+S but someone smarter than I am might shed some wisdom/history on this.</div><div style="font-family: Arial, sans-serif; font-size: 14px;"><br></div><div style="font-family: Arial, sans-serif; font-size: 14px;">Regards,</div><div style="font-family: Arial, sans-serif; font-size: 14px;">Juneidy</div>
<div style="font-family: Arial, sans-serif; font-size: 14px;" class="protonmail_signature_block protonmail_signature_block-empty">
    <div class="protonmail_signature_block-user protonmail_signature_block-empty">
        
            </div>
    
            <div class="protonmail_signature_block-proton protonmail_signature_block-empty">
        
            </div>
</div>