Documentation
¶
Index ¶
- Variables
- func Bypass() io.Writer
- func ForceUpdate()
- func GetTermProfil() termenv.Profile
- func GetTermProfile() termenv.Profile
- func GetTermSize() (cols, rows int)
- func HasDarkBackground() bool
- func Hyperlink(link, name string) string
- func Notify(title, body string)
- func SetMultiLinesUpdateFx(fx func() []string)
- func SetRawUpdateFx(fx func() []byte)
- func SetSingleLineUpdateFx(fx func() string)
- func Start() (err error)
- func Stop(clear bool) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // Config (must be changed before calling Start()) RefreshInterval = 100 * time.Millisecond // RefreshInterval defines the time between each output refresh Output io.Writer = os.Stdout // Terminal Output HideCursor = false // HideCursor defines if the cursor should be hidden or not during rendering (between Start() and Stop()) )
Functions ¶
func Bypass ¶
Bypass creates an io.Writer which allow to write permalent stuff to the terminal while liveterm is running. Do not forget to include a final '\n' when writting to it.
func ForceUpdate ¶
func ForceUpdate()
ForceUpdate forces an update of the terminal with dynamic data between ticks.
func GetTermProfil ¶ added in v2.1.0
GetTermProfil has a typo in its name, it is kept for backward compatibility. Deprecated: please use GetTermProfile() instead.
func GetTermProfile ¶ added in v2.2.0
GetTermProfile returns the termenv profile used by liveterm. It can be used to create styles and colors that will be compatible with the terminal within your updater function. If Start() has not been called yet, it will return the termenv profile of the current Output config value.
func GetTermSize ¶
func GetTermSize() (cols, rows int)
GetTermSize returns the last known terminal size. It is either updated automatically on terminal resize on Unix like systems or updated at each refresh/update interval for windows.
func HasDarkBackground ¶ added in v2.4.0
func HasDarkBackground() bool
HasDarkBackground returns whether terminal uses a dark-ish background. If Start() has not been called yet, it will return the current value of the Output config value.
func SetMultiLinesUpdateFx ¶
func SetMultiLinesUpdateFx(fx func() []string)
SetMultiLinesDataFx sets the function that will be called to get data update. There is no need to end each line with a '\n' as it will be added automatically.
func SetRawUpdateFx ¶
func SetRawUpdateFx(fx func() []byte)
SetRawUpdateFx sets the function that will be called to get data update.
func SetSingleLineUpdateFx ¶
func SetSingleLineUpdateFx(fx func() string)
SetSingleLineUpdateFx sets the function that will be called to get data update. There is no need to end each line with a '\n' as it will be added automatically.
Types ¶
This section is empty.