// Init initializes termui library. This function should be called before any others. // After initialization, the library must be finalized by 'Close' function. func Init() error { Body = NewGrid() Body.X = 0 Body.Y = 0 Body.BgColor = theme.BodyBg defer func() { w, _ := tm.Size() Body.Width = w evtListen() }() return tm.Init() }
// TermHeight returns the current terminal's height. func TermHeight() int { tm.Sync() _, h := tm.Size() return h }
// TermWidth returns the current terminal's width. func TermWidth() int { tm.Sync() w, _ := tm.Size() return w }