From 82565690c7561d41a4f4d21c7f5d069766fdc928 Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Sun, 22 Oct 2023 00:55:20 +0100 Subject: [PATCH] test driver.pl: don't redirect to STDOUT of interactive GDB --- test_regress/driver.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test_regress/driver.pl b/test_regress/driver.pl index 05b4c2ed9..3e53a89d3 100755 --- a/test_regress/driver.pl +++ b/test_regress/driver.pl @@ -1658,10 +1658,14 @@ sub _run { $SIG{ALRM} = 'DEFAULT'; $SIG{CHLD} = 'DEFAULT'; # Logging - open(STDOUT, ">&CHILDWR") or croak "%Error: Can't redirect stdout, stopped"; - open(STDERR, ">&STDOUT") or croak "%Error: Can't dup stdout, stopped"; - autoflush STDOUT 1; - autoflush STDERR 1; + if (!$opt_gdb) { + # Redirecting the stdout of GDB prevents output syntax colors + # and the use of the TUI, so only redirect when not --gdb + open(STDOUT, ">&CHILDWR") or croak "%Error: Can't redirect stdout, stopped"; + open(STDERR, ">&STDOUT") or croak "%Error: Can't dup stdout, stopped"; + autoflush STDOUT 1; + autoflush STDERR 1; + } system "$command"; my $status = $?; if (($status & 127) == 4 # SIGILL