From owner-svn-src-all@freebsd.org Mon Jan 16 02:00:06 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5746FCB267D; Mon, 16 Jan 2017 02:00:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id E2E5E1F7D; Mon, 16 Jan 2017 02:00:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from besplex.bde.org (c122-106-153-191.carlnfd1.nsw.optusnet.com.au [122.106.153.191]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id 4FD2A3C5EE3; Mon, 16 Jan 2017 13:00:02 +1100 (AEDT) Date: Mon, 16 Jan 2017 13:00:01 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Slawa Olhovchenkov cc: Julian Elischer , Mark Johnston , Bruce Evans , svn-src-head@freebsd.org, rang@acm.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r311952 - head/sys/ddb In-Reply-To: <20170115144531.GB58505@zxy.spb.ru> Message-ID: <20170116122019.E1170@besplex.bde.org> References: <201701120022.v0C0MaHq053076@repo.freebsd.org> <20170113131948.P1465@besplex.bde.org> <20170114220629.GB18065@raichu> <1755552c-a5e2-848a-38e2-3bacfbecfb23@elischer.org> <20170115144531.GB58505@zxy.spb.ru> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=H7qr+6Qi c=1 sm=1 tr=0 a=Tj3pCpwHnMupdyZSltBt7Q==:117 a=Tj3pCpwHnMupdyZSltBt7Q==:17 a=kj9zAlcOel0A:10 a=usmHoXVVML-mfzcKIW0A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Jan 2017 02:00:06 -0000 On Sun, 15 Jan 2017, Slawa Olhovchenkov wrote: > On Sun, Jan 15, 2017 at 01:07:58PM +0800, Julian Elischer wrote: > >> >> the old DEC machines had (from memory) ^O which dropped all pending >> output. >> Not so useful when there is 2MB of network buffers queued up to you, >> but very useful on >> and asr-33 teletype. > > Now it useful too, on serial console. > ^O processing be present years ago in FreeBSD, but removed at time of > tty code rewrite. As I know patch for restore exist, nobody > review/commit. Urk. I have fixes for hundreds of things broken in the rewrite, but didn't notice this one. The only fix I have near here is a partial one for funky quoting of control characters according to ECHOK and ECHOKE. ECHOK is a POSIX feature and ECHOKE is a BSD feature. The man page still docoments the old behaviour. Grepping for CCEQ (and its renaming to the worse name CMP_FLAG in the rewrite) shows that the only other control character with lost support is VDSUSP. Zgrepping for VDISCARD and VDSUSP in /usr/share/man shows the following bugs: - VDISCARD and VDSUSP are listed but not described in any useful way in termios(4) - VDSUSP (and dsusp) is listed but not described in any useful way in stty(1) - VDISCARD (and discard) are not mentioned in stty(1). However, 'stty discard c' works, and stty's display of the discard character works. stty's displays exactly the special characters that used to work. - VDISCARD and VDSUSP are otherwise undocumented. - FLUSHO in termios(4) and flusho in stty(1) are listed and described, but their close connection with VDISCARD is not mentioned (except stty says "being discarded"). FLUSHO is mostly an internal flag. In the working version, It is normally toggled by VDISCARD but is cleared by other actions. It can also be controlled by an ioctl, and stty supports the ioctl. But settings by stty are rarely useful since it is normally cleared by other The patch in the PR doesn't handle the other actions right. actions which stty can't control. Partial fixes for ECHOKE and nearby things: X Index: tty_ttydisc.c X =================================================================== X --- tty_ttydisc.c (revision 312117) X +++ tty_ttydisc.c (working copy) X @@ -798,6 +842,16 @@ X } X } else { X /* Don't print spaces. */ X + /* X + * XXX broken if VERASE is disabled. Can get here X + * then if ECHO is off and: X + * - for VERASE2 if that is not disabled X + * - for the buggy ECHOK/ECHOKE cases X + * - perhaps in other cases. X + * This routine is too generic. X + * X + * XXX the logic is not just non-printing of spaces. X + */ X ttydisc_echo(tp, tp->t_termios.c_cc[VERASE], 0); X } X } X @@ -993,7 +1049,30 @@ X ttydisc_rubchar(tp); X return (0); X } else if (CMP_CC(VKILL, c)) { X +#if 0 X + /* X + * XXX broken. This doesn't even look at ECHOK or X + * ECHOKE (nothing does now), and it doesn't produce X + * the documented behaviour of ECHOK. ECHOK exists X + * to be a non-erasing version of ECHOKE that uses X + * fewer terminal capabilities. ECHOPRT is also X + * broken (never even looked at). X + */ X while (ttydisc_rubchar(tp) == 0); X +#else X + if (CMP_FLAG(l, ECHOKE)) { X + /* XXX too hard to fix. */ X + while (ttydisc_rubchar(tp) == 0) X + ; X + } else { X + ttydisc_echo_force(tp, c, 0); X + if (CMP_FLAG(l, ECHOK)) X + ttydisc_echo_force(tp, '\n', 0); X + while (ttyinq_peekchar(&tp->t_inq, &c, X + "e) == 0) X + ttyinq_unputchar(&tp->t_inq); X + } X +#endif X return (0); X } else if (CMP_FLAG(l, IEXTEN)) { X if (CMP_CC(VWERASE, c)) { X @@ -1021,12 +1100,13 @@ X X parmrk: X if (CMP_FLAG(i, PARMRK)) { X - /* Prepend 0xff 0x00 0x.. */ X + /* Prepend 0xff 0x00. */ X ob[2] = c; X ol = 3; X quote = 1; X } else { X - ob[0] = c; X + /* Kill the character for read(). Keep it in c for echoing. */ X + ob[0] = '\0'; X ol = 1; X } X Bruce