Date: Thu, 14 Aug 2014 08:36:56 +0200 From: Eivind Evensen <eivinde@terraplane.org> To: Warner Losh <imp@bsdimp.com> Cc: FreeBSD Stable <freebsd-stable@freebsd.org>, John Marshall <john.marshall@riverwillow.com.au>, John Baldwin <jhb@freebsd.org> Subject: Re: Support DISCARD (^O) Message-ID: <20140814063655.GA95173@klump.hjerdalen.lokalnett> In-Reply-To: <0A198785-F7E5-4731-9DF7-587E6BDD03C9@bsdimp.com> References: <201408121644.18345.jhb@freebsd.org> <C2DEB4C5-8FB2-4CC0-9F87-2C927C92AE6C@bsdimp.com> <20140812234627.GA8627@rwpc15.gfn.riverwillow.net.au> <0A198785-F7E5-4731-9DF7-587E6BDD03C9@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Aug 12, 2014 at 05:51:44PM -0600, Warner Losh wrote: > > On Aug 12, 2014, at 5:46 PM, John Marshall <john.marshall@riverwillow.com.au> wrote: > > > On Tue, 12 Aug 2014, 17:12 -0600, Warner Losh wrote: > >> On Aug 12, 2014, at 2:44 PM, John Baldwin <jhb@FreeBSD.org> wrote: > >>> From: Eivind Nicolay Evensen <eivinde@terraplane.org> > >>> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140814063655.GA95173>