Date: Thu, 31 Dec 2009 10:53:05 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r201337 - stable/8/sys/kern Message-ID: <200912311053.nBVAr5Dm095558@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Thu Dec 31 10:53:04 2009 New Revision: 201337 URL: http://svn.freebsd.org/changeset/base/201337 Log: MFC r198185: Print backspaces after echoing an EOF. Applications like shells expect EOF to give no graphical output, while our implementation prints ^D by default (tunable with stty echoctl). Make the new implementation behave like the old TTY code. Print two backspaces afterwards. I totally forgot to MFC this, because the 8.0 freeze took a little longer than I expected. Reminded by: koitsu Modified: stable/8/sys/kern/tty_ttydisc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/tty_ttydisc.c ============================================================================== --- stable/8/sys/kern/tty_ttydisc.c Thu Dec 31 10:00:55 2009 (r201336) +++ stable/8/sys/kern/tty_ttydisc.c Thu Dec 31 10:53:04 2009 (r201337) @@ -624,15 +624,21 @@ ttydisc_echo_force(struct tty *tp, char /* * Only use ^X notation when ECHOCTL is turned on and * we've got an quoted control character. + * + * Print backspaces when echoing an end-of-file. */ - char ob[2] = { '^', '?' }; + char ob[4] = "^?\b\b"; /* Print ^X notation. */ if (c != 0x7f) ob[1] = c + 'A' - 1; - tp->t_column += 2; - return ttyoutq_write_nofrag(&tp->t_outq, ob, 2); + if (!quote && CMP_CC(VEOF, c)) { + return ttyoutq_write_nofrag(&tp->t_outq, ob, 4); + } else { + tp->t_column += 2; + return ttyoutq_write_nofrag(&tp->t_outq, ob, 2); + } } else { /* Can just be printed. */ tp->t_column++;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912311053.nBVAr5Dm095558>