#237

Built-in core: resize to fewer columns discards text instead of reflowing

Openjohnhenryopened 20d ago

@wterm/core 0.5.4, built-in core (@wterm/ghostty reflows, so this is specific to the built-in core).

import { WasmBridge } from '@wterm/core';
const b = await WasmBridge.load();
const row = (y, n) => { let s = ''; for (let x = 0; x < n; x++) { const c = b.getCell(y, x); s += c.char ? String.fromCodePoint(c.char) : ' '; } return s.trimEnd(); };
b.init(80, 24);
b.writeString('R'.repeat(80) + '\r\nsecond\r\n');
b.resize(40, 24);
console.log([row(0, 40), row(1, 40), row(2, 40)]);   // built-in: the second 40 'R's are gone (no reflow); @wterm/ghostty: two rows of 40 'R'

Output: ['RRRR…(40)', 'second', '']: the right half of the 80-column line is gone. With GhosttyCore the line wraps onto two 40-column rows. Narrowing a terminal pane (or a mobile rotation) therefore loses output with the built-in core. Expected: soft-wrapped lines reflow, or the limitation is documented next to resize().

Activity

0

No activity yet.