On Sun, Sep 27, 2015, at 20:14, Andreas Schwab wrote: > Benno Schulenberg <bensb...@justemail.net> writes: > > Or does it just mean that when ONLRET is set that the receiving > > end will do also a CR when a LF is received? The tty doesn't do > > any conversion, it just has to be aware that sending a LF causes > > also a CR in order to be able to line things up properly? > > Yes.
Hm. But the termios layer cannot know whether the sender is aware that NL also causes a carriage return, so it cannot take any compensatory action on the data coming through. So, ONLRET by itself does not do anything at all. Only when combined with ONOCR does it have an effect: not only after a CR but also after an NL any subsequent CRs are discarded, until some printable character moves the cursor out of column zero again. Right? Maybe then the documentation should mention that ONLRET is only useful in combination with ONOCR? Because otherwise the introduction of the "Output settings" section is somewhat misleading: "These settings control operations on data sent to the terminal." As ONLRET does not cause anything to be done with the data unless ONOCR is set. Glibc only documents ONLCR, not OCRNL nor ONLRET nor ONOCR. Is that just a lack of documentation? Or does it mean that the latter three flags are in effect nonfunctional? Benno -- http://www.fastmail.com - Access your email from home and the web