diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2005-10-23 10:03:24 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2005-10-23 10:03:24 +0000 |
commit | f3edb6c1329e1f9e48de7a07da851d249f0a7677 (patch) | |
tree | 1778b801cc97abd248eb6c650a152845bc3dc7c1 /usr.sbin/pkg_add | |
parent | 7d34d5c5c9a110e556321e70761e3048b08a42f2 (diff) |
if resumed from ^Z, display meter without waiting for changes.
idea from deraadt@
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm index a4e24e536fe..ead95698cdf 100644 --- a/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm +++ b/usr.sbin/pkg_add/OpenBSD/ProgressMeter.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: ProgressMeter.pm,v 1.6 2005/09/04 22:47:56 espie Exp $ +# $OpenBSD: ProgressMeter.pm,v 1.7 2005/10/23 10:03:23 espie Exp $ # # Copyright (c) 2004 Marc Espie <espie@openbsd.org> # @@ -24,6 +24,7 @@ my $header; my $lastdisplay = ''; my $isatty; my $enabled = 0; +my $continued = 0; # unless we know better my $width; @@ -80,6 +81,9 @@ sub set_header find_window_size(); compute_playfield(); }; + $SIG{'CONT'} = sub { + $continued = 1; + }; } return $isatty; } @@ -94,8 +98,9 @@ sub message } else { $d = $header; } - return if $d eq $lastdisplay; + return if $d eq $lastdisplay && !$continued; $lastdisplay=$d; + $continued = 0; print STDERR $d, "\r"; } |