fix(tui): handle empty bracketed paste fallback (#15594)

This commit is contained in:
Gille
2026-04-28 13:30:08 -06:00
committed by GitHub
parent 5d2f9b5d7d
commit 124da27767
2 changed files with 3 additions and 3 deletions

View File

@@ -927,8 +927,8 @@ export function TextInput({
} else {
v = v.slice(0, c)
}
} else if (inp.length > 0) {
const bracketed = inp.includes('[200~')
} else if (event.keypress.isPasted || inp.length > 0) {
const bracketed = event.keypress.isPasted || inp.includes('[200~')
const text = inp.replace(BRACKET_PASTE, '').replace(/\r\n/g, '\n').replace(/\r/g, '\n')
if (bracketed && emitPaste({ bracketed: true, cursor: c, text, value: v })) {