Skip to content

Commit

Permalink
Checking if writeable.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timofey Potapov committed Jul 20, 2024
1 parent 08f0919 commit 56c7cd2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/e.pm
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ sub import {
# Needs to be explicitly closed to avoid
# issues with next say() if still closed:
# "say() on closed filehandle STDOUT"
if ( !-t STDOUT and -e "/dev/tty" ) {
if ( !-t STDOUT and -w "/dev/tty" ) {
open my $tty, ">", "/dev/tty" or die $!;
caller->can( "utf8" )->( $tty ); # Method now in caller.
my $prefix = caller->can( "dye" )->( "no-stdout: ", "CYAN" );
Expand Down

0 comments on commit 56c7cd2

Please sign in to comment.