i3-wsbar: correctly handle EOF on stdin
This commit is contained in:
parent
3038ad6c26
commit
9d3c99ee38
7
i3-wsbar
7
i3-wsbar
|
@ -223,7 +223,12 @@ $stdin = AnyEvent->io(
|
||||||
fh => \*STDIN,
|
fh => \*STDIN,
|
||||||
poll => 'r',
|
poll => 'r',
|
||||||
cb => sub {
|
cb => sub {
|
||||||
chomp (my $line = <STDIN>);
|
my $line = <STDIN>;
|
||||||
|
if (!defined($line)) {
|
||||||
|
undef $stdin;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
chomp($line);
|
||||||
$last_line = $line;
|
$last_line = $line;
|
||||||
update_output();
|
update_output();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue