LineDiscipline
Defined in: src/drivers/tty/n_tty.ts:18
The N_TTY line discipline, i.e. drivers/tty/n_tty.c.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LineDiscipline(
tty):LineDiscipline
Defined in: src/drivers/tty/n_tty.ts:28
Parameters
Section titled “Parameters”Returns
Section titled “Returns”LineDiscipline
Properties
Section titled “Properties”buffer
Section titled “buffer”
protectedbuffer:number[] =[]
Defined in: src/drivers/tty/n_tty.ts:20
Input that is ready to be read, i.e. read_buf
protectedeof:boolean=false
Defined in: src/drivers/tty/n_tty.ts:26
Set by the EOF character, so the next read comes up empty instead of waiting
protectedline:number[] =[]
Defined in: src/drivers/tty/n_tty.ts:23
The line being typed, which isn’t readable until it is finished
protectedreadonlytty:TTY
Defined in: src/drivers/tty/n_tty.ts:28
Accessors
Section titled “Accessors”at_eof
Section titled “at_eof”Get Signature
Section titled “Get Signature”get at_eof():
boolean
Defined in: src/drivers/tty/n_tty.ts:134
Whether the terminal has been ended with the EOF character and has nothing left
Returns
Section titled “Returns”boolean
available
Section titled “available”Get Signature
Section titled “Get Signature”get available():
number
Defined in: src/drivers/tty/n_tty.ts:30
Returns
Section titled “Returns”number
canonical
Section titled “canonical”Get Signature
Section titled “Get Signature”get
protectedcanonical():boolean
Defined in: src/drivers/tty/n_tty.ts:35
Whether the terminal is handing over whole lines rather than single bytes
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”commit()
Section titled “commit()”
protectedcommit():void
Defined in: src/drivers/tty/n_tty.ts:115
Hand the line being typed over to be read, i.e. n_tty_receive_handle_newline
Returns
Section titled “Returns”void
echo()
Section titled “echo()”
protectedecho(…bytes):void
Defined in: src/drivers/tty/n_tty.ts:40
Echo bytes back to the terminal, if the terminal is set to echo
Parameters
Section titled “Parameters”…number[]
Returns
Section titled “Returns”void
flush()
Section titled “flush()”flush():
void
Defined in: src/drivers/tty/n_tty.ts:168
Throw away everything typed but not yet read, i.e. TCIFLUSH
Returns
Section titled “Returns”void
process_output()
Section titled “process_output()”process_output(
data):Uint8Array
Defined in: src/drivers/tty/n_tty.ts:142
Fix up bytes on their way to the terminal, i.e. do_output_char.
This is what turns a bare newline into the carriage return and newline a terminal actually needs.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”Uint8Array
push()
Section titled “push()”push(
text):void
Defined in: src/drivers/tty/n_tty.ts:175
Put text into the input queue as if it had been typed, i.e. TIOCSTI
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
read()
Section titled “read()”read(
buffer):number
Defined in: src/drivers/tty/n_tty.ts:124
Fill buffer with what is waiting and return how much that was.
Parameters
Section titled “Parameters”buffer
Section titled “buffer”Uint8Array
Returns
Section titled “Returns”number
receive()
Section titled “receive()”receive(
data):void
Defined in: src/drivers/tty/n_tty.ts:46
Take bytes that arrived from the terminal, i.e. n_tty_receive_buf.
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”void