From owner-freebsd-stable@FreeBSD.ORG Thu Aug 14 07:10:39 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 179DA282; Thu, 14 Aug 2014 07:10:39 +0000 (UTC) Received: from nmsh4.e.nsc.no (nmsh4.e.nsc.no [193.213.121.75]) by mx1.freebsd.org (Postfix) with ESMTP id 2E61F2BA2; Thu, 14 Aug 2014 07:10:37 +0000 (UTC) Received: from terraplane.org (ti0027a400-1392.bb.online.no [83.109.176.119]) by nmsh4.nsc.no (8.14.7/8.14.7) with ESMTP id s7E6WtrQ010677 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 14 Aug 2014 08:32:59 +0200 (MEST) Received: from terraplane.org (localhost [127.0.0.1]) by terraplane.org (8.14.5/8.14.5) with ESMTP id s7E6axGH095482; Thu, 14 Aug 2014 08:36:59 +0200 (CEST) (envelope-from rumrunner@terraplane.org) Received: (from rumrunner@localhost) by terraplane.org (8.14.5/8.13.8/Submit) id s7E6auKJ095481; Thu, 14 Aug 2014 08:36:56 +0200 (CEST) (envelope-from rumrunner) Date: Thu, 14 Aug 2014 08:36:56 +0200 From: Eivind Evensen To: Warner Losh Subject: Re: Support DISCARD (^O) Message-ID: <20140814063655.GA95173@klump.hjerdalen.lokalnett> References: <201408121644.18345.jhb@freebsd.org> <20140812234627.GA8627@rwpc15.gfn.riverwillow.net.au> <0A198785-F7E5-4731-9DF7-587E6BDD03C9@bsdimp.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0A198785-F7E5-4731-9DF7-587E6BDD03C9@bsdimp.com> Cc: FreeBSD Stable , John Marshall , John Baldwin 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: Thu, 14 Aug 2014 07:10:39 -0000 On Tue, Aug 12, 2014 at 05:51:44PM -0600, Warner Losh wrote: > > On Aug 12, 2014, at 5:46 PM, John Marshall wrote: > > > On Tue, 12 Aug 2014, 17:12 -0600, Warner Losh wrote: > >> On Aug 12, 2014, at 2:44 PM, John Baldwin wrote: > >>> From: Eivind Nicolay Evensen > >>> Date: July 5, 2014 at 4:34:16 AM MDT > >>> On Tue, Dec 17, 2013 at 10:18:16PM +0100, Eivind Evensen wrote: > >>>> > >>>> 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. > >>>> > >>>> Diff is against FreeBSD 8, however, last time I checked I didn't see > >>>> much difference in the newer versions. > >>> > >>> Here's a diff against FreeBSD 10. It seems to work fine there too. > > > >> DISCARD is supposed to turn back off after any character that you > >> type, not just ^O again. > > > > Irrespective of exactly how it's implemented, I'd love to see this. > > Coming from a VMS background, I was used to a ^O toggle. I reach for ^O > > whenever I unintentionally initiate a huge stream of terminal output > > over a WAN link. > > I was hoping someone would fix that :) However, I agree with you: > having ^O toggle is better than its current state. While I still haven't made it turn off automatically on input yet, I noticed (on FreeBSD 10 with clang) that uio-uio->resid also should be set to 0 to avoid programs that check the return of write perpetually redoing writes (which clang made very apparent). It's the (currently) last attachment on the PR: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=184987 -- Eivind