diff --git a/src/terminal.go b/src/terminal.go index 8cd82141..a355ab4f 100644 --- a/src/terminal.go +++ b/src/terminal.go @@ -6847,7 +6847,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 = ¤t case actBracketedPasteEnd: if t.pasting != nil {