Archived
1
0

Fixed the TerminalSize command.

This commit is contained in:
Jip J. Dekker 2013-10-15 23:01:09 +02:00
parent 1d0a06f83a
commit 3e17c99b71
2 changed files with 6 additions and 5 deletions

View File

@ -16,6 +16,5 @@ func signalCatcher() {
func main() {
go signalCatcher()
go showMenu()
return
showMenu()
}

View File

@ -2,9 +2,9 @@ package main
import (
"fmt"
"log"
"os"
"os/exec"
"strconv"
"strings"
)
@ -15,9 +15,11 @@ const (
func terminalSize() (width, height int) {
cmd := exec.Command("stty", "size")
cmd.Stdin = os.Stdin
out, err := cmd.Output()
out, _ := cmd.Output()
sizes := strings.Split(string(out), " ")
return sizes[1], sizes[0]
width, _ = strconv.Atoi(sizes[1])
height, _ = strconv.Atoi(sizes[0])
return width, height
}
func showMenu() {