Skip to content

term.termios #

https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/bits/termios.h

fn flag #

@[inline]
fn flag(value int) TcFlag

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

fn invert #

@[inline]
fn invert(value TcFlag) TcFlag

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

fn ioctl #

@[inline]
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 #

@[inline]
fn tcgetattr(fd int, mut termios_p Termios) int

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

fn tcsetattr #

@[inline]
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 #

Available on Linux, Android and Termux only.

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.

Available on macOS, FreeBSD, OpenBSD, NetBSD and DragonFly BSD only.

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

Termios stores the terminal options

Available on Solaris only.

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

Termios stores the terminal options

struct Termios #

Available on Linux, Android and Termux only.

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
}

Available on macOS, FreeBSD, OpenBSD, NetBSD and DragonFly BSD only.

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

Available on Windows, iOS, Haiku, SerenityOS and Vinix only.

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

Termios represents platform dependent flags representing the terminal state. Linux https://github.com/lattera/glibc/blob/master/sysdeps/unix/sysv/linux/bits/termios.h OpenBSD https://github.com/openbsd/src/blob/master/sys/sys/termios.h FreeBSD https://web.mit.edu/freebsd/head/sys/sys/_termios.h Solaris https://github.com/omniti-labs/illumos-omnios/blob/master/usr/src/uts/common/sys/termios.h DragonFly https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/sys/sys/_termios.h QNX https://github.com/vocho/openqnx/blob/master/trunk/lib/c/public/termios.h

Available on Solaris only.

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

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).