/** * The one place bytes reach the terminal, like less's output.c. * * less never writes to the tty as it goes: every putchr appends to an * 8K obuf (output.c:117) and only flush() hands it over, at the few * points where the user is about to be kept waiting — cmd_exec before * a command runs (command.c:128), the prompts that read a key, and * term_deinit. Everything a command emits therefore lands in ONE * write, and the intermediate states are never drawn. * * Node's process.stdout.write on a tty is the opposite: synchronous * and unbuffered, one syscall per call, each one rendered. Writing * directly meant a single arrow key reached the terminal as five * separate writes — clear, "ESC", backspaces, "[", "B" — and the * terminal drew every one of them. A trackpad fling delivers hundreds * of those: the prompt flickers and the escape sequence is visible as * it forms. The bytes were right the whole time, which is why every * byte-level corpus passed; only the write BOUNDARIES were wrong. */ /** * Appends to the output buffer, like less's putstr/putchr. * * A full buffer flushes itself, as less's putchr does — that bounds the * memory and is the only flush the caller does not choose. */ export declare function putstr(text: string): void; /** * Hands the buffer to the terminal, like less's flush(). * * Call before anything that makes the user wait — reading a key, * running a command, leaving the pager. Cheap when empty, so an * over-eager call costs nothing but a branch; a MISSING one is what * hurts, since output then sits until the buffer fills. */ export declare function flush(): void; /** Drops anything unwritten, for a teardown that must not emit. */ export declare function discardOutput(): void; /** What is waiting to go out, for tests. */ export declare const pendingOutput: () => string;