mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-02 14:03:06 +00:00
16 lines
274 B
Go
16 lines
274 B
Go
package main
|
|
|
|
import (
|
|
"os"
|
|
|
|
"golang.org/x/term"
|
|
)
|
|
|
|
func GetTerminalDimensions() (int, int) {
|
|
physicalWidth, physicalHeight, err := term.GetSize(int(os.Stdout.Fd()))
|
|
if err != nil {
|
|
panic("Could not determine terminal size")
|
|
}
|
|
return physicalWidth, physicalHeight
|
|
}
|