Skip to content

Commit a934721

Browse files
author
chessman
committed
multiChoice: use stdout.Fd instead of hardcoded zero
1 parent 17f86db commit a934721

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ishell.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,8 @@ func (s *Shell) multiChoice(options []string, text string, init []int, multiResu
478478
return nil
479479
}
480480

481-
_, maxRows, err := readline.GetSize(0)
481+
stdoutFd := int(os.Stdout.Fd())
482+
_, maxRows, err := readline.GetSize(stdoutFd)
482483
if err != nil {
483484
return nil
484485
}
@@ -559,7 +560,7 @@ func (s *Shell) multiChoice(options []string, text string, init []int, multiResu
559560
case <-refresh:
560561
update()
561562
case <-t.C:
562-
_, rows, _ := readline.GetSize(0)
563+
_, rows, _ := readline.GetSize(stdoutFd)
563564
if maxRows != rows {
564565
maxRows = rows
565566
update()

0 commit comments

Comments
 (0)