Fixed an error on the line ending of stty.
This commit is contained in:
parent
cececb1f81
commit
99e4cddf06
7
menu.go
7
menu.go
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user