Summary
Storm parses bracketed-paste escape sequences (PASTE_START / PASTE_END) inside input/manager.js, exports BRACKETED_PASTE_ENABLE / BRACKETED_PASTE_DISABLE constants from core/ansi.js, and exposes a usePaste hook — but the terminal mode is never actually enabled, so pastes arrive as a stream of ordinary keypress events and usePaste never fires.
Repro
import { render, usePaste, useInput, Text } from "@orchetron/storm";
function App() {
usePaste((text) => console.log("paste:", text));
useInput((e) => console.log("key:", e.key, e.char));
return <Text>ready</Text>;
}
render(<App />, { alternateScreen: true });
Paste any multi-character string. Expected: one paste: log. Actual: a key: log per character, no paste: log.
Cause
grep -rn "BRACKETED_PASTE_ENABLE\|2004h" dist/ shows the constant defined in dist/core/ansi.js but never written anywhere. The terminal stays in non-bracketed mode, so the parser in input/manager.js never sees PASTE_START.
Workaround
Emit the enable sequence manually on app startup:
process.stdout.write("\x1b[?2004h");
After that, usePaste fires correctly with the full pasted string in a single event.
Proposed fix
Screen.start() (or wherever ALT_SCREEN_ENTER / MOUSE_ENABLE are emitted in core/screen.js) should also emit BRACKETED_PASTE_ENABLE, and stop() should emit BRACKETED_PASTE_DISABLE, gated on the terminal capability check that already exists in core/terminal-detect.ts (bracketedPaste: true for known modern terminals).
Environment
@orchetron/storm 0.2.0
- Bun 1.3.11
- macOS 25.4.0 (Darwin arm64)
Summary
Storm parses bracketed-paste escape sequences (
PASTE_START/PASTE_END) insideinput/manager.js, exportsBRACKETED_PASTE_ENABLE/BRACKETED_PASTE_DISABLEconstants fromcore/ansi.js, and exposes ausePastehook — but the terminal mode is never actually enabled, so pastes arrive as a stream of ordinary keypress events andusePastenever fires.Repro
Paste any multi-character string. Expected: one
paste:log. Actual: akey:log per character, nopaste:log.Cause
grep -rn "BRACKETED_PASTE_ENABLE\|2004h" dist/shows the constant defined indist/core/ansi.jsbut never written anywhere. The terminal stays in non-bracketed mode, so the parser ininput/manager.jsnever seesPASTE_START.Workaround
Emit the enable sequence manually on app startup:
After that,
usePastefires correctly with the full pasted string in a single event.Proposed fix
Screen.start()(or whereverALT_SCREEN_ENTER/MOUSE_ENABLEare emitted incore/screen.js) should also emitBRACKETED_PASTE_ENABLE, andstop()should emitBRACKETED_PASTE_DISABLE, gated on the terminal capability check that already exists incore/terminal-detect.ts(bracketedPaste: truefor known modern terminals).Environment
@orchetron/storm0.2.0