bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cbreak+echo+nl: carriage return but no newline


From: G. Branden Robinson
Subject: Re: cbreak+echo+nl: carriage return but no newline
Date: Mon, 25 Mar 2024 22:22:41 -0500

At 2024-03-12T03:31:46-0500, G. Branden Robinson wrote:
> 1.  Echo is enabled.
> 2.  The window is not a pad.
> 3.  The carriage return "echoes" (the cursor moves to column 0).
> 4.  The character is not erase, KEY_LEFT, or KEY_BACKSPACE.
> 5.  The character is not some other KEY_* code.
> 6.  The character is a carriage return.
> 7.  "nl" is enabled.
> 8.  No "translation" (or supplementary) line feed occurs.
> 
> What gives?

It turns out that (A) this has come up before[1] and (B) it's all there
in the manual.[2]  All I had to do was check a man page where `nl()` and
`nonl()` _aren't_ documented!

I'll be submitting a patch to:

1.  Relocate this material from outopts PORTABILITY to inopts HISTORY;
2.  Provide a pointer from the former to the latter;
3.  Wordsmith the language and markup a little, because I can't help it.

Sample:

HISTORY
     Formerly, ncurses used nl and nonl to control the conversion of
     newlines to carriage return/line feed on output as well as input.
     X/Open Curses documents the use of these functions only for input.
     This difference arose from converting the pcurses source (1986),
     which used ioctl(2) calls and the sgttyb structure, to termios (the
     POSIX terminal API).  In the former, both input and output were
     controlled via a single option CRMOD, while the latter separates
     these features.  Because that conversion interferes with output
     optimization, ncurses 6.2 (2020) amended nl and nonl to eliminate
     their effect on output.

Regards,
Branden

[1] https://lists.gnu.org/archive/html/bug-ncurses/2020-09/msg00018.html
[2] https://invisible-island.net/ncurses/man/curs_outopts.3x.html#h2-PORTABILITY

"Are you boys gonna chase down your leads or are you gonna sit drinkin'
coffee in the ONE HOUSE in the STATE where I know my boy AIN'T AT?"

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]