From owner-freebsd-stable@FreeBSD.ORG Tue Aug 12 23:12:21 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF91F2EF for ; Tue, 12 Aug 2014 23:12:21 +0000 (UTC) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FBEB24B6 for ; Tue, 12 Aug 2014 23:12:20 +0000 (UTC) Received: by mail-pd0-f177.google.com with SMTP id p10so13361270pdj.36 for ; Tue, 12 Aug 2014 16:12:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=0cIXGJlfXC9IzDFAg+jKUHh0Jyb+R19pB43UKUqopRQ=; b=Wv7fBZNsR1H/m9yiLVE6+xD1ph9d5MNMxbpPRBgC4wsX7p/2UA99/pIoQbu9m/PEop jGgdoGS9cbUvTdAl5owuJSvXNLdJIX3zLwgsKsLGeO/HeTInkBJNTtQG7CuzXtWnVQ9X qfsHF9pi3U9cvBmpesm5shZ2yZ1gdB5pnL9J/RUc5ocd0I4dGrwDqT8Tu8mAkFuHgD+S 2eDFzfwZzSdyQcovuERJJHsiUfU8SCisRUYEPzcvjnFtPmjqRAM0VnSXzZipQWRjFH8t hz0cTw5VWpIAl8HOxW2pOL1UZFB1PSOrwazOCirn3MSDBy/AT34Wsrj/Q2w64iV/PG8f OGmg== X-Gm-Message-State: ALoCoQlyUrbOvb9FP8b2V6PYRUjdhZ5AWj7Lx1EfiWF/5PGwQ70gwWpkQHTRoHDnMD1BN4IA9iDC X-Received: by 10.68.69.70 with SMTP id c6mr556445pbu.129.1407885140299; Tue, 12 Aug 2014 16:12:20 -0700 (PDT) Received: from lgmac-rtangirala.corp.netflix.com (dc1-prod.netflix.com. [69.53.236.251]) by mx.google.com with ESMTPSA id w7sm71503pbs.74.2014.08.12.16.12.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Aug 2014 16:12:19 -0700 (PDT) Sender: Warner Losh Content-Type: multipart/signed; boundary="Apple-Mail=_DB0F305D-2115-476B-B11A-525896BDCBD3"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Support DISCARD (^O) From: Warner Losh In-Reply-To: <201408121644.18345.jhb@freebsd.org> Date: Tue, 12 Aug 2014 17:12:17 -0600 Message-Id: References: <201408121644.18345.jhb@freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1878.6) Cc: FreeBSD Stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Aug 2014 23:12:21 -0000 --Apple-Mail=_DB0F305D-2115-476B-B11A-525896BDCBD3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On Aug 12, 2014, at 2:44 PM, John Baldwin wrote: >=20 > --=20 > John Baldwin >=20 > From: Eivind Nicolay Evensen > Subject: Re: Support DISCARD (^O) > Date: July 5, 2014 at 4:34:16 AM MDT > To: freebsd-stable@freebsd.org >=20 >=20 > On Tue, Dec 17, 2013 at 10:18:16PM +0100, Eivind Evensen wrote: >> Hello. >>=20 >> I don't know if there is any particular reason that support for = DISCARD/^O >> was not included in the tty rewrite that happened from FreeBSD 7 to = 8, >> but in case anybody else wants it, here's a diff functioning mostly >> like in 7, except output isn't switched back on automatically on = input. >>=20 >> Diff is against FreeBSD 8, however, last time I checked I didn't see >> much difference in the newer versions. >=20 > Here's a diff against FreeBSD 10. It seems to work fine there too. >=20 >=20 > diff -r 59ad9c4b7916 -r 6e500f4552b4 sys/kern/tty_ttydisc.c > --- a/sys/kern/tty_ttydisc.c Fri Jul 04 17:27:59 2014 +0200 > +++ b/sys/kern/tty_ttydisc.c Fri Jul 04 17:29:29 2014 +0200 > @@ -464,6 +464,9 @@ > if (tp->t_flags & TF_ZOMBIE) > return (EIO); >=20 > + if (tp->t_termios.c_lflag & FLUSHO) > + return (0); > + > /* > * We don't need to check whether the process is the foreground > * process group or if we have a carrier. This is already done > @@ -896,6 +899,14 @@ >=20 > /* Special control characters that are implementation dependent. = */ > if (CMP_FLAG(l, IEXTEN)) { > + /* Discard (^O) */ > + if (CMP_CC(VDISCARD, c)) { > + if (!(tp->t_termios.c_lflag & FLUSHO)) > + ttyoutq_write_nofrag(&tp->t_outq, "^O", = 2); > + tp->t_termios.c_lflag ^=3D FLUSHO; > + return(0); > + } > + DISCARD is supposed to turn back off after any character that you type, = not just ^O again. Warner --Apple-Mail=_DB0F305D-2115-476B-B11A-525896BDCBD3 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJT6p9RAAoJEGwc0Sh9sBEASYkP/0xhT0gQs8pGBz8NLQn1KLqX x7yhDjmhruuWBejQfLtKR/xzxinriybYUjzgnq9p46TjU909QTvy8TuY2h1X6iDh WFGeDxobraBdseaHNHrhoATizbJhXWe2ffoJX1ODou4aioL6hvyKpPXmpvv0qGes SKcJBligeVJmlPSFXe5n1d4K9DbD9ljdbc2Z314VPaOEzwduigXkDV5ssQH3DGE5 9D8J8RlMhSz4PIFVPKMCH4wB3mk9YMIjeyxuC6uRbkbpUelF6+O07XeP5rWaPyzC YbR4ljs6Jwp+wO9PAfzjdP4EhuEBQgOElDDznpm0u4H1R3Sh213pghW/yQ3Hoaux HB44YikTtUiWctGfleLoFWV1y3stMXtt0njqxoRFHSPJ4TUuEe0W3AZoqSP5HBhm iEb6jLKHECkGgKT6Wc/8EwApUKRUWzSCtnkgv6q5x18DB9NDMel2U/yZFF4+COFj xStvWNMHAhTXAWwxSV5bXH9dFYknhgZ9iAzk5Iz2YPlxSs/SBQmTUHSeC/UkekSW 40Geo49LODSCSHfxZHn9D57qYO5FV5s7VB6jtVhzwL2GFDW73JNFtmWCQRMYOwUn kIIaYtvP6rQBmaet/SH5rr9/N8spdQtejF2kYnajzF5f1k3hCyu5Jzu15v30vuOS UwHpMWjpslOfgIBxbfog =DOoy -----END PGP SIGNATURE----- --Apple-Mail=_DB0F305D-2115-476B-B11A-525896BDCBD3--