Skip to content

LineDiscipline

Defined in: src/drivers/tty/n_tty.ts:17

The N_TTY line discipline, i.e. drivers/tty/n_tty.c.

new LineDiscipline(tty): LineDiscipline

Defined in: src/drivers/tty/n_tty.ts:27

TTY

LineDiscipline

protected buffer: number[] = []

Defined in: src/drivers/tty/n_tty.ts:19

Input that is ready to be read, i.e. read_buf


protected eof: boolean = false

Defined in: src/drivers/tty/n_tty.ts:25

Set by the EOF character, so the next read comes up empty instead of waiting


protected line: number[] = []

Defined in: src/drivers/tty/n_tty.ts:22

The line being typed, which isn’t readable until it is finished


protected readonly tty: TTY

Defined in: src/drivers/tty/n_tty.ts:27

get at_eof(): boolean

Defined in: src/drivers/tty/n_tty.ts:133

Whether the terminal has been ended with the EOF character and has nothing left

boolean


get available(): number

Defined in: src/drivers/tty/n_tty.ts:29

number


get protected canonical(): boolean

Defined in: src/drivers/tty/n_tty.ts:34

Whether the terminal is handing over whole lines rather than single bytes

boolean

protected commit(): void

Defined in: src/drivers/tty/n_tty.ts:114

Hand the line being typed over to be read, i.e. n_tty_receive_handle_newline

void


protected echo(…bytes): void

Defined in: src/drivers/tty/n_tty.ts:39

Echo bytes back to the terminal, if the terminal is set to echo

…number[]

void


flush(): void

Defined in: src/drivers/tty/n_tty.ts:167

Throw away everything typed but not yet read, i.e. TCIFLUSH

void


process_output(data): Uint8Array

Defined in: src/drivers/tty/n_tty.ts:141

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.

Uint8Array

Uint8Array


push(text): void

Defined in: src/drivers/tty/n_tty.ts:174

Put text into the input queue as if it had been typed, i.e. TIOCSTI

string

void


read(buffer): number

Defined in: src/drivers/tty/n_tty.ts:123

Fill buffer with what is waiting and return how much that was.

Uint8Array

number


receive(data): void

Defined in: src/drivers/tty/n_tty.ts:45

Take bytes that arrived from the terminal, i.e. n_tty_receive_buf.

Uint8Array

void