Skip to content

term.termios #

fn flag #

fn flag(value int) TcFlag

flag provides a termios flag of the correct size for the underlying C.termios structure

fn invert #

fn invert(value TcFlag) TcFlag

invert is a platform dependant way to bitwise NOT (~) TcFlag as its length varies across platforms

fn ioctl #

fn ioctl(fd int, request u64, arg voidptr) int

ioctl is an unsafe wrapper around C.ioctl and keeps its semantic

fn set_state #

fn set_state(fd int, new_state Termios) int

set_state applies the flags in the new_state to the descriptor fd.

fn tcgetattr #

fn tcgetattr(fd int, mut termios_p Termios) int

tcgetattr is an unsafe wrapper around C.termios and keeps its semantic

fn tcsetattr #

fn tcsetattr(fd int, optional_actions int, mut termios_p Termios) int

tcsetattr is an unsafe wrapper around C.termios and keeps its semantic

struct C.termios #

struct C.termios {
mut:
	c_iflag  TcFlag
	c_oflag  TcFlag
	c_cflag  TcFlag
	c_lflag  TcFlag
	c_line   Cc
	c_cc     [cclen]Cc
	c_ispeed Speed
	c_ospeed Speed
}

Termios stores the terminal options on Linux.

struct Termios #

struct Termios {
pub mut:
	c_iflag  TcFlag
	c_oflag  TcFlag
	c_cflag  TcFlag
	c_lflag  TcFlag
	c_line   Cc
	c_cc     [cclen]Cc
	c_ispeed Speed
	c_ospeed Speed
}

fn (Termios) disable_echo #

fn (mut t Termios) disable_echo()

disable_echo disables echoing characters as they are typed, when that Termios state is later set with termios.set_state(fd,t)