term

package module
v0.0.0-...-10d3ab4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2025 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultFd

func DefaultFd() int

func GetSize

func GetSize(fd int) (width, height int, err error)
GetSize returns the visible dimensions of the given terminal.

These dimensions don't include any scrollback buffer height.

func IsTerminal

func IsTerminal(fd int) bool

IsTerminal returns whether the given file descriptor is a terminal.

func Restore

func Restore(fd int, oldState *State) error

Restore restores the terminal connected to the given file descriptor to a previous state.

Types

type State

type State = term.State

State contains the state of a terminal.

func MakeRaw

func MakeRaw(fd int) (*State, error)

MakeRaw puts the terminal connected to the given file descriptor into raw mode and returns the previous state of the terminal so that it can be restored.

type Terminal

type Terminal struct {
	// contains filtered or unexported fields
}

func NewTerminal

func NewTerminal(fd int) *Terminal

func (*Terminal) Fd

func (t *Terminal) Fd() int

func (*Terminal) GetSize

func (t *Terminal) GetSize() (width, height int, err error)

func (*Terminal) HasState

func (t *Terminal) HasState() bool

func (*Terminal) IsTerminal

func (t *Terminal) IsTerminal() bool

func (*Terminal) MakeRaw

func (t *Terminal) MakeRaw() error

func (*Terminal) Restore

func (t *Terminal) Restore() error

func (*Terminal) State

func (t *Terminal) State() *State

Directories

Path Synopsis
Package ctl provides low-level ANSI escape sequences for terminal control.
Package ctl provides low-level ANSI escape sequences for terminal control.
this is for key event, i don't want to you know, hard code this and maybe i guess my implementation is stupid i mean yeah i do this stuff for learning though.
this is for key event, i don't want to you know, hard code this and maybe i guess my implementation is stupid i mean yeah i do this stuff for learning though.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL