diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-09 11:52:53 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2020-02-09 11:52:53 -0700 |
commit | 077816ac1acf33419a54b5d859e695aced4711df (patch) | |
tree | 3e76d0ec17d968b48fc48674014a0bbc0c22abc4 /perl5 | |
parent | f4fe0e4fe463aa5e46cb0e147c5f304e768c7780 (diff) | |
download | dotfiles-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.pm | 3 |
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) { |