diff --git a/src/bun/terminal_io.ts b/src/bun/terminal_io.ts index 53ac6e9..2152fae 100644 --- a/src/bun/terminal_io.ts +++ b/src/bun/terminal_io.ts @@ -20,15 +20,14 @@ const BunTerminalIO: ITerminal = { }, getTerminalSize: async function getTerminalSize(): Promise { const encoder = new TextEncoder(); - const write = (s: string) => Bun.write(Bun.stdout, encoder.encode(s)); // Tell the cursor to move to Row 999 and Column 999 // Since this command specifically doesn't go off the screen // When we ask where the cursor is, we should get the size of the screen - await write(Ansi.moveCursorForward(999) + Ansi.moveCursorDown(999)); + await BunTerminalIO.writeStdout(Ansi.moveCursorForward(999) + Ansi.moveCursorDown(999)); // Ask where the cursor is - await write(Ansi.GetCursorLocation); + await BunTerminalIO.writeStdout(Ansi.GetCursorLocation); // Get the first chunk from stdin // The response is \x1b[(rows);(cols)R.. @@ -44,7 +43,7 @@ const BunTerminalIO: ITerminal = { const cols = parseInt(scols, 10) ?? 80; // Clear the screen - await write(Ansi.ClearScreen + Ansi.ResetCursor); + await BunTerminalIO.writeStdout(Ansi.ClearScreen + Ansi.ResetCursor); return { rows,