summaryrefslogtreecommitdiff
path: root/perl5
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-09 11:52:53 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-09 11:52:53 -0700
commit077816ac1acf33419a54b5d859e695aced4711df (patch)
tree3e76d0ec17d968b48fc48674014a0bbc0c22abc4 /perl5
parentf4fe0e4fe463aa5e46cb0e147c5f304e768c7780 (diff)
downloaddotfiles-077816ac1acf33419a54b5d859e695aced4711df.tar.gz
unbuffer only STDOUT, and only for duration of function
We don't need to unbuffer STDERR as we merge the streams and do not print to STDERR. And it is better to do this only for the duration of the function rather than having an additional side effect.
Diffstat (limited to 'perl5')
-rw-r--r--perl5/Local/Interactive.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/perl5/Local/Interactive.pm b/perl5/Local/Interactive.pm
index b450982e..a97d993c 100644
--- a/perl5/Local/Interactive.pm
+++ b/perl5/Local/Interactive.pm
@@ -192,8 +192,7 @@ sub _sysptycap_tty {
my $slave = $pty->slave;
$slave->clone_winsize_from(\*STDIN) if POSIX::isatty(*STDIN);
$slave->set_raw; # so we can 'sysread' rather than 'read'
- STDOUT->autoflush(1);
- STDERR->autoflush(1);
+ local $| = 1;
my $pid = fork;
die "fork() failed: $!" unless defined $pid;
unless ($pid) {