Shell – What does the “opost” stty flag do

linuxshellsttyterminal

The documentation says the following:

[-]opost postprocess output

I don't understand what this means. I have tried to disable this flag to see what it does:

stty -opost -F /dev/pts/0

And I have typed the ls command, and the result had the first line indented:

enter image description here

I still don't get what this flag does!

Best Answer

stty -opost deactivates post-processing output. For example, normally sending a <LF> (U+00A0) character to the terminal will automatically insert a <CR> (U+000D) character, to make the cursor go to the beginning of the next line. Most importantly, setting -opost deactivates all processing of output, irrespective of any other output options.

See the manual page for stty(1) for details.

Related Question