Copy input snapshot on bracketed paste begin
CodeQL / Analyze (go) (push) Has been cancelled
build / build (push) Has been cancelled
Test fzf on macOS / build (push) Has been cancelled

[]rune(t.input) is a same-type conversion that aliases t.input;
in-place query edits during the paste corrupt the snapshot and skew
the paste-end comparison.
This commit is contained in:
Junegunn Choi
2026-07-03 08:58:06 +09:00
parent a7a1464418
commit bb295fb2b2
+3 -1
View File
@@ -6844,7 +6844,9 @@ func (t *Terminal) Loop() error {
t.mutex.Unlock()
return false
case actBracketedPasteBegin:
current := []rune(t.input)
// Clone: []rune(t.input) would alias t.input, and in-place
// query edits during the paste would corrupt the snapshot
current := slices.Clone(t.input)
t.pasting = &current
case actBracketedPasteEnd:
if t.pasting != nil {