Skip to content

Commit 0fb78dc

Browse files
authored
Update repeater.go, fix for #16
I have the same issue, and my screen reader is needed for an automation tool, so I can't disable it. With this code. I have tested it works for after the change. PS: The code is done w/ Copilot's help.
1 parent b82a602 commit 0fb78dc

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

repeater.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ func newRepeater(ctx context.Context, powershell string, pipename string) (*repe
6060
// wait for the process start up
6161
go func() {
6262
// the process should output "\xff" if it starts successfully
63+
// ignore any output until we got "\xff"
6364
buf := make([]byte, 1)
64-
n, err := out.Read(buf)
65-
done <- err == nil && n == 1 && buf[0] == 0xff
65+
for {
66+
n, err := out.Read(buf)
67+
if err != nil {
68+
done <- false
69+
return
70+
}
71+
if n == 1 && buf[0] == 0xff {
72+
done <- true
73+
return
74+
}
75+
}
6676
}()
6777

6878
select {

0 commit comments

Comments
 (0)