Archived
1
0

Fixed an error on the line ending of stty.

This commit is contained in:
Jip J. Dekker 2013-10-16 18:05:06 +02:00
parent cececb1f81
commit 99e4cddf06

View File

@ -16,9 +16,10 @@ func terminalSize() (width, height int) {
cmd := exec.Command("stty", "size") cmd := exec.Command("stty", "size")
cmd.Stdin = os.Stdin cmd.Stdin = os.Stdin
out, _ := cmd.Output() out, _ := cmd.Output()
sizes := strings.Split(string(out), " ") sizes := strings.Trim(string(out), "\n")
width, _ = strconv.Atoi(sizes[1]) size := strings.Split(sizes, " ")
height, _ = strconv.Atoi(sizes[0]) width, _ = strconv.Atoi(size[1])
height, _ = strconv.Atoi(size[0])
return width, height return width, height
} }