From a9347218b3867e84af91e33a6a60e80d1a80b570 Mon Sep 17 00:00:00 2001 From: chessman Date: Tue, 13 Feb 2018 16:59:47 +0200 Subject: [PATCH] multiChoice: use stdout.Fd instead of hardcoded zero --- ishell.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ishell.go b/ishell.go index 70dd6a7..f9db90e 100644 --- a/ishell.go +++ b/ishell.go @@ -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 } @@ -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()