]> git.proxmox.com Git - pve-installer.git/commitdiff
UI: turn on autoflush for STDOUT
authorChristoph Heiss <c.heiss@proxmox.com>
Tue, 20 Jun 2023 12:17:25 +0000 (14:17 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Jun 2023 14:07:15 +0000 (16:07 +0200)
Otherwise, when STDOUT is connected to a pipe, it will not get flushed
completely after each message, which might than hangs the installer UI.

Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Proxmox/UI/Base.pm
Proxmox/UI/StdIO.pm

index 05af9c198c504738336bf68e219bb002f1c03341..288bf810271794939071072ed3d5bb33caf3f9c0 100644 (file)
@@ -17,9 +17,17 @@ sub new {
        env => $env,
     }, $class;
 
+    $self->init();
+
     return $self;
 }
 
+sub init {
+    my ($self) = @_;
+
+    # optional
+}
+
 sub message {
     my ($self, $msg) = @_;
 
index c73e1249ffb43c110425163f5bc1c3fdf6fdddf6..f510dd3071b413a16aa0356731867ec8916a4e4a 100644 (file)
@@ -5,6 +5,12 @@ use warnings;
 
 use base qw(Proxmox::UI::Base);
 
+sub init {
+    my ($self) = @_;
+
+    STDOUT->autoflush(1);
+}
+
 sub message {
     my ($self, $msg) = @_;