File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -287,10 +287,15 @@ func (r *Reflex) runCommand(name string, stdout chan<- OutMsg) {
287
287
288
288
go func () {
289
289
scanner := bufio .NewScanner (tty )
290
+ // Allow for lines up to 100 MB.
291
+ scanner .Buffer (nil , 100e6 )
290
292
for scanner .Scan () {
291
293
stdout <- OutMsg {r .id , scanner .Text ()}
292
294
}
293
- // Intentionally ignoring scanner.Err() for now. Unfortunately,
295
+ if err := scanner .Err (); errors .Is (err , bufio .ErrTooLong ) {
296
+ infoPrintln (r .id , "Error: subprocess emitted a line longer than 100 MB" )
297
+ }
298
+ // Intentionally ignore other scanner errors. Unfortunately,
294
299
// the pty returns a read error when the child dies naturally,
295
300
// so I'm just going to ignore errors here unless I can find a
296
301
// better way to handle it.
You can’t perform that action at this time.
0 commit comments