public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] termios.3: Clarify the description of ONLRET
@ 2021-11-29 15:00 Simon Branch
  0 siblings, 0 replies; only message in thread
From: Simon Branch @ 2021-11-29 15:00 UTC (permalink / raw)
  To: linux-man; +Cc: alx.manpages, mtk.manpages, Simon Branch

Hello!  While perusing various termios(3) and termios(4) manpages (as one does)
I noticed the following inconsistency for ONLRET.  FreeBSD and NetBSD say
this:

   If ONLRET is set, the NL character is assumed to do the carriage-return
   function; the column pointer will be set to 0.

OpenBSD says this:

   If ONLRET is set, NL also performs CR on output, and reset current column
   to 0.

POSIX says this:

   NL performs CR function.

The current Linux manpage says this (!):

   Don't output CR.

Perhaps I'm misunderstanding the purpose of this flag, but (if nothing else) the
constrast here is a little confusing.  It looks like Linux follows the same
behavior as all the other platforms:

   $ stty -icanon -onlcr -icrnl -echo onlret onocr; cat
   this is some text			(^J pressed)
                    and some more	(^M pressed before additional text)

Comments?  OK?

---
 man3/termios.3 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/man3/termios.3 b/man3/termios.3
index c11937458..20641f14d 100644
--- a/man3/termios.3
+++ b/man3/termios.3
@@ -203,7 +203,9 @@ Map CR to NL on output.
 Don't output CR at column 0.
 .TP
 .B ONLRET
-Don't output CR.
+The NL character is assumed to do the carriage-return function;
+the kernel's idea of the current column is set to 0
+after both NL and CR.
 .TP
 .B OFILL
 Send fill characters for a delay, rather than using a timed delay.
-- 
2.34.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-29 18:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-29 15:00 [patch] termios.3: Clarify the description of ONLRET Simon Branch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox