From 2e3dd5c2936b137da54a3238018423b3e2ec9260 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..f0c2dbf 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 := 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()