FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 03-23-2011, 02:41 PM
Dave Reisner
 
Default Proposed fix for FS#20538

https://bugs.archlinux.org/task/20538

The attached patch flushes the terminal input buffer shortly before
prompting users for input to answer a question. On the one hand, I can
see how this might be nice when you accidentally hit <enter> twice, or
fat finger a key during a download and press <enter> at the prompt only
to be oddly returned to your shell. On the other hand, I've occasionally
abused this exact behavior to walk away from my computer in the middle
of a large -Syu.

Thoughts? Any issues with the code approach?

dave
 
Old 03-24-2011, 04:18 AM
Dan McGee
 
Default Proposed fix for FS#20538

On Wed, Mar 23, 2011 at 10:41 AM, Dave Reisner <d@falconindy.com> wrote:
> https://bugs.archlinux.org/task/20538
>
> The attached patch flushes the terminal input buffer shortly before
> prompting users for input to answer a question. On the one hand, I can
> see how this might be nice when you accidentally hit <enter> twice, or
> fat finger a key during a download and press <enter> at the prompt only
> to be oddly returned to your shell. On the other hand, I've occasionally
> abused this exact behavior to walk away from my computer in the middle
> of a large -Syu.
>
> Thoughts? Any issues with the code approach?

You only use it in util, mark it static and drop it from util.h.

Is this stuff we should guard using autoconf? I think if you add it to
AC_CHECK_HEADERS and AC_CHECK_FUNCS you'll have useful #defines usable
from config.h.

-Dan
 
Old 03-24-2011, 12:23 PM
Dave Reisner
 
Default Proposed fix for FS#20538

On Thu, Mar 24, 2011 at 12:18:20AM -0500, Dan McGee wrote:
> On Wed, Mar 23, 2011 at 10:41 AM, Dave Reisner <d@falconindy.com> wrote:
> > https://bugs.archlinux.org/task/20538
> >
> > The attached patch flushes the terminal input buffer shortly before
> > prompting users for input to answer a question. On the one hand, I can
> > see how this might be nice when you accidentally hit <enter> twice, or
> > fat finger a key during a download and press <enter> at the prompt only
> > to be oddly returned to your shell. On the other hand, I've occasionally
> > abused this exact behavior to walk away from my computer in the middle
> > of a large -Syu.
> >
> > Thoughts? Any issues with the code approach?
>
> You only use it in util, mark it static and drop it from util.h.
>
> Is this stuff we should guard using autoconf? I think if you add it to
> AC_CHECK_HEADERS and AC_CHECK_FUNCS you'll have useful #defines usable
> from config.h.
>
> -Dan
>

Done, and done. I've made flush_term_input effectively a NOOP when
tcflush isn't available. Changes are in my GH repo [1].

dave

[1] http://goo.gl/qQG91
 

Thread Tools




All times are GMT. The time now is 01:05 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org