Usage
API
#
TERMIOS.TERMIOS
— Module.
This package provides an interface to the POSIX calls for tty I/O control.
For a complete description of these calls, see the termios(3) manual page.
Usage
Example:
using TERMIOS const T = TERMIOS term_stdin = T.termios() T.tcgetattr(stdin, term_stdin) term_stdin.c_iflag |= T.IGNBRK T.tcsetattr(stdin, T.TCSANOW, term_stdin)
#
TERMIOS.ALTWERASE
— Constant.
Use alternate WERASE algorithm
#
TERMIOS.BRKINT
— Constant.
Map BREAK to SIGINTR
#
TERMIOS.BS0
— Constant.
BS delay type 0.
#
TERMIOS.BS1
— Constant.
BS delay type 1.
#
TERMIOS.CCAR_OFLOW
— Constant.
DCD flow control of output
#
TERMIOS.CCTS_OFLOW
— Constant.
CTS flow control of output
#
TERMIOS.CDSR_OFLOW
— Constant.
DSR flow control of output
#
TERMIOS.CDTR_IFLOW
— Constant.
DTR flow control of input
#
TERMIOS.CIGNORE
— Constant.
Ignore control flags
#
TERMIOS.CLOCAL
— Constant.
Ignore modem status lines
#
TERMIOS.CR0
— Constant.
CR delay type 0.
#
TERMIOS.CR1
— Constant.
CR delay type 1.
#
TERMIOS.CR2
— Constant.
CR delay type 2.
#
TERMIOS.CR3
— Constant.
CR delay type 3.
#
TERMIOS.CREAD
— Constant.
Enable receiver
#
TERMIOS.CRTS_IFLOW
— Constant.
RTS flow control of input
#
TERMIOS.CS5
— Constant.
5 bits (pseudo)
#
TERMIOS.CS6
— Constant.
6 bits
#
TERMIOS.CS7
— Constant.
7 bits
#
TERMIOS.CS8
— Constant.
8 bits
#
TERMIOS.CSIZE
— Constant.
Character size mask
#
TERMIOS.CSTOPB
— Constant.
Send 2 stop bits
#
TERMIOS.ECHO
— Constant.
Enable echoing
#
TERMIOS.ECHOCTL
— Constant.
Echo control chars as ^(Char)
#
TERMIOS.ECHOE
— Constant.
Visually erase chars
#
TERMIOS.ECHOK
— Constant.
Echo NL after line kill
#
TERMIOS.ECHOKE
— Constant.
Visual erase for line kill
#
TERMIOS.ECHONL
— Constant.
Echo NL even if ECHO is off
#
TERMIOS.ECHOPRT
— Constant.
Visual erase mode for hardcopy
#
TERMIOS.EXTPROC
— Constant.
External processing
#
TERMIOS.FF0
— Constant.
FF delay type 0.
#
TERMIOS.FF1
— Constant.
FF delay type 1.
#
TERMIOS.FFDLY
— Constant.
Form feed delay
#
TERMIOS.FLUSHO
— Constant.
Output being flushed (state)
#
TERMIOS.HUPCL
— Constant.
Hang up on last close
#
TERMIOS.ICANON
— Constant.
Canonicalize input lines
#
TERMIOS.ICRNL
— Constant.
Map CR to NL (ala CRMOD)
#
TERMIOS.IEXTEN
— Constant.
Enable DISCARD and LNEXT
#
TERMIOS.IGNBRK
— Constant.
Ignore BREAK condition
#
TERMIOS.IGNCR
— Constant.
Ignore CR
#
TERMIOS.IGNPAR
— Constant.
Ignore (discard) parity errors
#
TERMIOS.IMAXBEL
— Constant.
Ring bell on input queue full
#
TERMIOS.INLCR
— Constant.
Map NL into CR
#
TERMIOS.INPCK
— Constant.
Enable checking of parity errors
#
TERMIOS.ISIG
— Constant.
Enable signals INTR, QUIT, [D]SUSP
#
TERMIOS.ISTRIP
— Constant.
Strip 8th bit off chars
#
TERMIOS.IUCLC
— Constant.
(glibc) Translate upper case input to lower case.
#
TERMIOS.IUTF8
— Constant.
(macos) maintain state for UTF-8 VERASE
#
TERMIOS.IXANY
— Constant.
Any char will restart after stop
#
TERMIOS.IXOFF
— Constant.
Enable input flow control
#
TERMIOS.IXON
— Constant.
Enable output flow control
#
TERMIOS.MDMBUF
— Constant.
Old name for CCAR_OFLOW
#
TERMIOS.NL0
— Constant.
NL type 0.
#
TERMIOS.NOFLSH
— Constant.
Don't flush after interrupt
#
TERMIOS.NOKERNINFO
— Constant.
No kernel output from VSTATUS
#
TERMIOS.OCRNL
— Constant.
Map CR to NL on output
#
TERMIOS.OFDEL
— Constant.
Fill is DEL, else NUL
#
TERMIOS.OFILL
— Constant.
Use fill characters for delay
#
TERMIOS.OLCUC
— Constant.
(glibc) Translate lower case output to upper case.
#
TERMIOS.ONLCR
— Constant.
Map NL to CR-NL (ala CRMOD)
#
TERMIOS.ONLRET
— Constant.
NL performs CR function
#
TERMIOS.ONOCR
— Constant.
No CR output at column 0
#
TERMIOS.ONOEOT
— Constant.
Discard EOT's (^D) on output)
#
TERMIOS.OPOST
— Constant.
Enable following output processing
#
TERMIOS.OXTABS
— Constant.
Expand tabs to spaces
#
TERMIOS.PARENB
— Constant.
Parity enable
#
TERMIOS.PARMRK
— Constant.
Mark parity and framing errors
#
TERMIOS.PARODD
— Constant.
Odd parity, else even
#
TERMIOS.PENDIN
— Constant.
XXX retype pending input (state)
#
TERMIOS.TAB0
— Constant.
TAB delay type 0.
#
TERMIOS.TAB1
— Constant.
TAB delay type 1.
#
TERMIOS.TAB2
— Constant.
TAB delay type 2.
#
TERMIOS.TAB3
— Constant.
Expand tabs to spaces.
#
TERMIOS.TABDLY
— Constant.
Horizontal tab delay
#
TERMIOS.TCIFLUSH
— Constant.
Discard data received but not yet read.
#
TERMIOS.TCIOFF
— Constant.
Send a STOP character.
#
TERMIOS.TCIOFLUSH
— Constant.
Discard all pending data.
#
TERMIOS.TCION
— Constant.
Send a START character.
#
TERMIOS.TCOFLUSH
— Constant.
Discard data written but not yet sent.
#
TERMIOS.TCOOFF
— Constant.
Suspend output.
#
TERMIOS.TCOON
— Constant.
Restart suspended output.
#
TERMIOS.TCSADRAIN
— Constant.
Drain output, then change
#
TERMIOS.TCSAFLUSH
— Constant.
Drain output, flush input
#
TERMIOS.TCSANOW
— Constant.
Make change immediate
#
TERMIOS.TCSASOFT
— Constant.
Flag - don't alter h.w. state
#
TERMIOS.TOSTOP
— Constant.
Stop background jobs from output
#
TERMIOS.VDISCARD
— Constant.
Discard character IEXTEN
#
TERMIOS.VDSUSP
— Constant.
Delayed suspend character ISIG together with IEXTEN
#
TERMIOS.VEOF
— Constant.
End-of-file character ICANON
#
TERMIOS.VEOL
— Constant.
End-of-line character ICANON
#
TERMIOS.VEOL2
— Constant.
Second EOL character ICANON together with IEXTEN
#
TERMIOS.VERASE
— Constant.
Erase character ICANON
#
TERMIOS.VINTR
— Constant.
Interrupt character ISIG
#
TERMIOS.VKILL
— Constant.
Kill-line character ICANON
#
TERMIOS.VLNEXT
— Constant.
Literal-next character IEXTEN
#
TERMIOS.VMIN
— Constant.
Minimum number of bytes read at once !ICANON
#
TERMIOS.VQUIT
— Constant.
Quit character ISIG
#
TERMIOS.VREPRINT
— Constant.
Reprint-line character ICANON together with IEXTEN
#
TERMIOS.VSTART
— Constant.
Start (X-ON) character IXON, IXOFF
#
TERMIOS.VSTATUS
— Constant.
Status character ICANON together with IEXTEN
#
TERMIOS.VSTOP
— Constant.
Stop (X-OFF) character IXON, IXOFF
#
TERMIOS.VSUSP
— Constant.
Suspend character ISIG
#
TERMIOS.VT0
— Constant.
VT delay type 0.
#
TERMIOS.VT1
— Constant.
VT delay type 1.
#
TERMIOS.VTDLY
— Constant.
Vertical tab delay
#
TERMIOS.VTIME
— Constant.
Time-out value (tenths of a second) !ICANON
#
TERMIOS.VWERASE
— Constant.
Word-erase character ICANON together with IEXTEN
#
TERMIOS.cfgetispeed
— Method.
cfgetispeed(term::termios) -> Int
Returns the input baud rate stored in the termios structure.
#
TERMIOS.cfgetospeed
— Method.
cfgetospeed(term::termios) -> Int
Returns the output baud rate stored in the termios structure.
#
TERMIOS.cfmakeraw
— Method.
cfmakeraw(term::termios)
Set the terminal to something like the "raw" mode of the old Version 7 terminal driver: input is available character by character, echoing is disabled, and all special processing of terminal input and output characters is disabled. The terminal attributes are set as follows:
term.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); term.c_oflag &= ~OPOST; term.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); term.c_cflag &= ~(CSIZE | PARENB); term.c_cflag |= CS8;
#
TERMIOS.cfsetispeed
— Method.
cfsetispeed(term::termios, speed::Integer)
sets the input baud rate stored in the termios structure to speed, which must be one of these constants:
TERMIOS.B0
TERMIOS.B50
TERMIOS.B75
TERMIOS.B110
TERMIOS.B134
TERMIOS.B150
TERMIOS.B200
TERMIOS.B300
TERMIOS.B600
TERMIOS.B1200
TERMIOS.B1800
TERMIOS.B2400
TERMIOS.B4800
TERMIOS.B9600
TERMIOS.B19200
TERMIOS.B38400
TERMIOS.B57600
TERMIOS.B115200
TERMIOS.B230400
The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines shall no longer be asserted. Normally, this will disconnect the line. CBAUDEX is a mask for the speeds beyond those defined in POSIX.1 (57600 and above). Thus, B57600 & CBAUDEX is nonzero.
#
TERMIOS.cfsetospeed
— Method.
cfsetospeed(term::termios, speed::Integer)
sets the output baud rate stored in the termios structure to speed, which must be one of these constants:
TERMIOS.B0
TERMIOS.B50
TERMIOS.B75
TERMIOS.B110
TERMIOS.B134
TERMIOS.B150
TERMIOS.B200
TERMIOS.B300
TERMIOS.B600
TERMIOS.B1200
TERMIOS.B1800
TERMIOS.B2400
TERMIOS.B4800
TERMIOS.B9600
TERMIOS.B19200
TERMIOS.B38400
TERMIOS.B57600
TERMIOS.B115200
TERMIOS.B230400
The zero baud rate, B0, is used to terminate the connection. If B0 is specified, the modem control lines shall no longer be asserted. Normally, this will disconnect the line. CBAUDEX is a mask for the speeds beyond those defined in POSIX.1 (57600 and above). Thus, B57600 & CBAUDEX is nonzero.
#
TERMIOS.cfsetspeed
— Method.
cfsetspeed(term::termios, speed::Int)
is a 4.4BSD extension. It takes the same arguments as cfsetispeed(), and sets both input and output speed.
#
TERMIOS.tcdrain
— Method.
tcdrain(s::Base.LibuvStream)
Wait until all output written to file descriptor fd has been transmitted.
#
TERMIOS.tcflow
— Method.
tcflow(s::Base.LibuvStream, action::Integer)
Suspend transmission or reception of data on the object referred to by fd, depending on the value of action:
TERMIOS.TCOOFF
to suspend output,TERMIOS.TCOON
to restart outputTERMIOS.TCIOFF
to suspend input,TERMIOS.TCION
to restart input.
#
TERMIOS.tcflush
— Method.
tcflush(s::Base.LibuvStream, queue::Integer)
Discard data written to the object referred to by fd but not transmitted, or data received but not read, depending on the value of queue_selector:
TERMIOS.TCIFLUSH
flushes data received but not read.TERMIOS.TCOFLUSH
flushes data written but not transmitted.TERMIOS.TCIOFLUSH
flushes both data received but not read, and data written but not transmitted.
#
TERMIOS.tcgetattr
— Method.
tcgetattr(fd::RawFD, term::termios) tcgetattr(s::Base.LibuvStream, term::termios) tcgetattr(f::Int, term::termios)
Get the tty attributes for file descriptor fd
#
TERMIOS.tcsendbreak
— Method.
tcsendbreak(s::Base.LibuvStream, duration::Integer)
Transmit a continuous stream of zero-valued bits for a specific duration, if the terminal is using asynchronous serial data transmission. If duration is zero, it transmits zero-valued bits for at least 0.25 seconds, and not more that 0.5 seconds. If duration is not zero, it sends zero-valued bits for some implementation-defined length of time.
If the terminal is not using asynchronous serial data transmission, tcsendbreak() returns without taking any action.
#
TERMIOS.tcsetattr
— Method.
tcsetattr(s::Base.LibuvStream, when::Integer, term::termios)
Set the tty attributes for file descriptor fd. The when argument determines when the attributes are changed:
TERMIOS.TCSANOW
to change immediatelyTERMIOS.TCSADRAIN
to change after transmitting all queued outputTERMIOS.TCSAFLUSH
to change after transmitting all queued output and discarding all queued input.