From aaf071b1bf396badd7627157e69d5361cc75a5aa Mon Sep 17 00:00:00 2001 From: maxlandon Date: Mon, 5 Jun 2023 01:03:30 +0000 Subject: [PATCH] dev (#50) * Load default options * fix stupid * Fix clearline after input buffer * Change UNIX newlines with returned newlines in display (more reliable) * Always use original terminal file descriptor for low-level cursor requests, and potentially most other virtual terminal sequences. * Don't code too late in the night * Fix term length * Fix --- internal/term/term.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/term/term.go b/internal/term/term.go index 58d6100..fcf7306 100644 --- a/internal/term/term.go +++ b/internal/term/term.go @@ -41,13 +41,13 @@ func GetWidth() (termWidth int) { // GetLength returns the length of the terminal // (Y length), or 80 if it cannot be established. func GetLength() int { - width, _, err := term.GetSize(int(stdoutTerm.Fd())) + _, length, err := term.GetSize(0) - if err != nil || width == 0 { + if err != nil || length == 0 { return defaultTermWidth } - return width + return length } func printf(format string, a ...interface{}) {