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.Stdin = os.Stdin
out, _ := cmd.Output()
sizes := strings.Split(string(out), " ")
width, _ = strconv.Atoi(sizes[1])
height, _ = strconv.Atoi(sizes[0])
sizes := strings.Trim(string(out), "\n")
size := strings.Split(sizes, " ")
width, _ = strconv.Atoi(size[1])
height, _ = strconv.Atoi(size[0])
return width, height
}