Skip to content

Commit

Permalink
multiChoice: use stdout.Fd instead of hardcoded zero
Browse files Browse the repository at this point in the history
  • Loading branch information
chessman committed Feb 13, 2018
1 parent 17f86db commit a934721
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ishell.go
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,8 @@ func (s *Shell) multiChoice(options []string, text string, init []int, multiResu
return nil
}

_, maxRows, err := readline.GetSize(0)
stdoutFd := int(os.Stdout.Fd())
_, maxRows, err := readline.GetSize(stdoutFd)
if err != nil {
return nil
}
Expand Down Expand Up @@ -559,7 +560,7 @@ func (s *Shell) multiChoice(options []string, text string, init []int, multiResu
case <-refresh:
update()
case <-t.C:
_, rows, _ := readline.GetSize(0)
_, rows, _ := readline.GetSize(stdoutFd)
if maxRows != rows {
maxRows = rows
update()
Expand Down

0 comments on commit a934721

Please sign in to comment.