ivanilves/travelgrunt

View on GitHub
pkg/terminal/terminal.go

Summary

Maintainability
A
0 mins
Test Coverage
package terminal

import (
    "golang.org/x/term"
)

const defautHeight = 20

// Height reveals a number of lines we have in our terminal
func Height() int {
    _, h, err := term.GetSize(0)

    if err != nil {
        return defautHeight
    }

    return h
}