Date: Sun, 21 Jan 2024 06:07:31 +0100 From: Soumendra Ganguly <soumendraganguly@gmail.com> To: freebsd-bugs@freebsd.org Subject: Unset ICRNL in CBREAK mode in stty(1) following X/Open Curses Message-ID: <CAOW54GWzkJ1zc_7CjY3nq-DMqnopvyPMk9rnttBrFR%2BZsgL62g@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--0000000000005bba01060f6db19b Content-Type: text/plain; charset="UTF-8" Respected maintainers, In X/Open Curses, Issue 7 ( https://pubs.opengroup.org/onlinepubs/9699909599/toc.pdf), the following is mentioned about the cbreak mode: This mode achieves the same effect as non-canonical-mode, Case B input processing (with MIN set to 1 and *ICRNL cleared*) as specified in the XBD specification. For example, ncurses does this in NCURSES_SP_NAME(cbreak): https://github.com/mirror/ncurses/blob/87c2c84cbd2332d6d94b12a1dcaf12ad1a51a938/ncurses/tinfo/lib_raw.c#L177 My question is this: I understand that the standard linked above is NOT a specification for stty but rather for curses, and therefore the FreeBSD implementation of stty need not follow it. *But*, would this be a welcome change in stty for the sake of sticking to *some* standard? Or could this potentially break lots of existing projects? --------------------------------------------- Some context: I had made some changes in the tty library of Python to make it more standard compliant: https://githubcom/python/cpython/pull/101832 <https://github.com/python/cpython/pull/101832> This is a part of a series of changes: https://github.com/python/cpython/issues/85984 The particular change of concern is that in `tty.setcbreak()`, I unset ICRNL. Because of this change , some old behavior is broken: https://github.com/python/cpython/issues/114328 Sincerely, Soumendra --0000000000005bba01060f6db19b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr"><div>Respected maintainers,</div><br><div= ><div dir=3D"ltr"><div><div>In X/Open Curses, Issue 7 (<a href=3D"https://p= ubs.opengroup.org/onlinepubs/9699909599/toc.pdf" target=3D"_blank">https://= pubs.opengroup.org/onlinepubs/9699909599/toc.pdf</a>), the following is men= tioned about the cbreak mode:</div><div><br></div><div>This mode achieves t= he same effect as non-canonical-mode, Case B input processing (with<br> MIN set to 1 and <strong>ICRNL cleared</strong>) as specified in the XBD sp= ecification.</div><div><br><div>For example, ncurses does this in NCURSES_S= P_NAME(cbreak):=20 <a href=3D"https://github.com/mirror/ncurses/blob/87c2c84cbd2332d6d94b12a1d= caf12ad1a51a938/ncurses/tinfo/lib_raw.c#L177" target=3D"_blank">https://git= hub.com/mirror/ncurses/blob/87c2c84cbd2332d6d94b12a1dcaf12ad1a51a938/ncurse= s/tinfo/lib_raw.c#L177</a></div><div><br><div>My question is this: I understand that the standard linked above is NOT a=20 specification for stty but rather for curses, and therefore the FreeBSD=20 implementation of stty need not follow it. *But*, would this=20 be a welcome change in stty for the sake of sticking to *some* standard? Or could this potentially break lots of existing projects?<br></div></div>= </div></div><div><br></div><div>-------------------------------------------= --<br></div><div><br></div><div>Some context: I had made some changes in th= e tty library of Python to make it more standard compliant: <a href=3D"http= s://github.com/python/cpython/pull/101832" target=3D"_blank">https://github= com/python/cpython/pull/101832</a></div><div><br></div><div>This is a part = of a series of changes: <a href=3D"https://github.com/python/cpython/issues= /85984" target=3D"_blank">https://github.com/python/cpython/issues/85984</a= ></div><div><br></div><div>The particular change of concern is that in `tty.setcbreak()`, I unset=20 ICRNL. Because of this change , some old behavior is broken: <a href=3D"htt= ps://github.com/python/cpython/issues/114328" target=3D"_blank">https://git= hub.com/python/cpython/issues/114328</a></div><div><br></div><div>Sincerely= ,</div><div>Soumendra<div class=3D"gmail-yj6qo"></div><div class=3D"gmail-a= dL"><br><br></div></div></div></div></div></div> --0000000000005bba01060f6db19b--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOW54GWzkJ1zc_7CjY3nq-DMqnopvyPMk9rnttBrFR%2BZsgL62g>