fix(tui): use paste timeout when rearming paste watchdog

Match the buffered-stdin rearm cadence to IN_PASTE state so large pastes do not spin the normal escape timeout while waiting for readable data to drain.
This commit is contained in:
Brooklyn Nicholson 2026-04-28 22:21:44 -05:00
parent f542d17b00
commit 10ad7006b6

View file

@ -332,7 +332,10 @@ export default class App extends PureComponent<Props, State> {
// drain stdin next and clear this timer. Prevents both the spurious // drain stdin next and clear this timer. Prevents both the spurious
// Escape key and the lost scroll event. // Escape key and the lost scroll event.
if (this.props.stdin.readableLength > 0) { if (this.props.stdin.readableLength > 0) {
this.incompleteEscapeTimer = setTimeout(this.flushIncomplete, this.NORMAL_TIMEOUT) this.incompleteEscapeTimer = setTimeout(
this.flushIncomplete,
this.keyParseState.mode === 'IN_PASTE' ? this.PASTE_TIMEOUT : this.NORMAL_TIMEOUT
)
return return
} }