From f42ad60751ee46b53266a55dd9fbdea01f6d3a3f Mon Sep 17 00:00:00 2001 From: Janne Koschinski Date: Fri, 3 Nov 2017 09:28:19 +0100 Subject: [PATCH] Fixed an issue with the terminal width detection that was contributed. --- powerline.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/powerline.go b/powerline.go index 86bee610..d9a3a1aa 100644 --- a/powerline.go +++ b/powerline.go @@ -79,16 +79,16 @@ func (p *powerline) appendSegment(origin string, segment segment) { } func termWidth() int { - termWidth, _, err := terminal.GetSize(int(os.Stdout.Fd())) + termWidth, _, err := terminal.GetSize(int(os.Stdin.Fd())) if err != nil { shellMaxLengthStr, found := os.LookupEnv("COLUMNS") if !found { - return 80 // Otherwise 0 default. + return 0 } shellMaxLength64, err := strconv.ParseInt(shellMaxLengthStr, 0, 64) if err != nil { - return 80 // Otherwise 0 default. + return 0 } termWidth = int(shellMaxLength64)