log: allow locking the terminal #65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
export interface HeadlessWidgetEnv {/** Recieves ANSI escape sequences for interactive data. */writeInteractive(text: string): void;/** Recieves log content (from `writeLine`). */writeOutput(text: string): void;/** Monotonic. */now(): ReturnType<typeof performance.now>;/** 0ms indicates "one frame". */wait(ms: number, cb: () => void): () => void;/** Called often. */getSize(): { columns: number; rows: number };/** Called to enable input events */onInput?(write: (bytes: Uint8Array | string) => void): () => void;}problem is for pichu's runtime, they state that it'll be like
console.stream.out.getWriter(), but that means you need a lock on the standard io to implement this interface. but obviously, youre cooked if you just always hold a lock.i propose changing this interface to
the write lock is held whenever a widget is visible, but it can be freed by calling getDrawLock(). now we can also avoid injecting to console on Node.js unconditionally.
clo referenced this issue2026-01-26 01:32:03 -08:00