From owner-svn-src-stable-8@FreeBSD.ORG Thu Dec 31 10:53:05 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C041106566C; Thu, 31 Dec 2009 10:53:05 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B1E8FC18; Thu, 31 Dec 2009 10:53:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBVAr5d2095560; Thu, 31 Dec 2009 10:53:05 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBVAr5Dm095558; Thu, 31 Dec 2009 10:53:05 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200912311053.nBVAr5Dm095558@svn.freebsd.org> From: Ed Schouten Date: Thu, 31 Dec 2009 10:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r201337 - stable/8/sys/kern X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2009 10:53:05 -0000 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++;