Skip to content

LineDiscipline

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

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

new LineDiscipline(tty): LineDiscipline

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

TTY

LineDiscipline

protected buffer: number[] = []

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

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


protected eof: 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


protected line: number[] = []

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

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


protected readonly tty: TTY

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

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

boolean


get available(): number

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

number


get protected canonical(): boolean

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

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

boolean

protected commit(): 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

void


protected echo(…bytes): void

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

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:168

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

void


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.

Uint8Array

Uint8Array


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

string

void


read(buffer): number

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

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:46

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

Uint8Array

void