summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2021-01-30 10:37:23 +0000
committerMarc Espie <espie@cvs.openbsd.org>2021-01-30 10:37:23 +0000
commit6843776a7ee474e4d98e00d3eb7e979b2ce78d44 (patch)
tree0b1097f6c14c9983095b52189629a9bf724c2a6f
parent0096630510ab646d22f1f25025cd20a0e8fd4a6e (diff)
rework API slightly, so that handle_continue is an explicit method
(to be overrideen by subclasses when needed)
-rw-r--r--usr.sbin/pkg_add/OpenBSD/State.pm10
-rw-r--r--usr.sbin/pkg_add/OpenBSD/State.pod7
2 files changed, 14 insertions, 3 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/State.pm b/usr.sbin/pkg_add/OpenBSD/State.pm
index 51c7b7f2c1e..38d3c6f82b9 100644
--- a/usr.sbin/pkg_add/OpenBSD/State.pm
+++ b/usr.sbin/pkg_add/OpenBSD/State.pm
@@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
-# $OpenBSD: State.pm,v 1.65 2021/01/08 14:21:37 espie Exp $
+# $OpenBSD: State.pm,v 1.66 2021/01/30 10:37:22 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
@@ -128,6 +128,12 @@ sub repo
return $self->{repo};
}
+sub handle_continue
+{
+ my $self = shift;
+ $self->find_window_size(1);
+}
+
sub sync_display
{
}
@@ -375,7 +381,7 @@ sub find_window_size
};
}
$SIG{'CONT'} = sub {
- $self->find_window_size(1);
+ $self->handle_continue;
}
}
diff --git a/usr.sbin/pkg_add/OpenBSD/State.pod b/usr.sbin/pkg_add/OpenBSD/State.pod
index a6b002e4666..85d27cb2660 100644
--- a/usr.sbin/pkg_add/OpenBSD/State.pod
+++ b/usr.sbin/pkg_add/OpenBSD/State.pod
@@ -1,4 +1,4 @@
-$OpenBSD: State.pod,v 1.1 2020/12/20 15:30:58 daniel Exp $
+$OpenBSD: State.pod,v 1.2 2021/01/30 10:37:22 espie Exp $
=head1 NAME
@@ -108,6 +108,11 @@ string.
basic formatting function used by C<print> and friends, return the formatted
string.
+=item $state->handle_continue;
+
+callback for C<SIGCONT>, to be overridden by subclasses if some specific
+treatment (such as terminal redraw/reset) is needed.
+
=back
=head1 BUGS