Copy input snapshot on bracketed paste begin
Some checks are pending
CodeQL / Analyze (push) Waiting to run
build / build (push) Waiting to run
Test fzf on macOS / build (push) Waiting to run

[]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-05 11:08:58 +09:00
parent 978ded5cd0
commit a1fb01462d

View file

@ -6885,7 +6885,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 {