You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bracketed (terminal-native) paste bypasses read-only mode and modifies the bufferΒ #2674
When a buffer is in read-only mode, a terminal-native bracketed paste (e.g. right-click paste, middle-click paste, or Ctrl+Shift+V in most terminals) still inserts text into the buffer. Typing and Ctrl+V are correctly blocked, but the bracketed-paste path is not, so a "read-only" buffer can be silently modified.
Steps to Reproduce
Open any file: fresh testfile.txt
Enable read-only mode (Command Palette β "Toggle Read-Only Mode"). The status bar shows [RO].
Confirm editing is blocked:
Type some characters β nothing is inserted, status bar shows "Editing disabled in this buffer". β
Press Ctrl+V (with something on the clipboard) β nothing is inserted, "Editing disabled in this buffer". β
Now paste using the terminal's own paste (bracketed paste), e.g. right-click β Paste, middle-click, or Ctrl+Shift+V.
(Reproducible from a script via tmux: tmux set-buffer -b pb "PASTED"; tmux paste-buffer -b pb -p targeting the fresh pane β -p wraps the text in bracketed-paste markers, exactly like a real terminal paste.)
Actual Behavior
The pasted text is inserted into the read-only buffer:
Buffer content changes (the pasted text appears at the cursor).
The tab title gains a * (unsaved-changes marker).
Status bar shows "Pasted".
The [RO] read-only indicator is still displayed the whole time.
Expected Behavior
Bracketed paste should be blocked in a read-only buffer, exactly like typing and Ctrl+V β no insertion, and the "Editing disabled in this buffer" message.
Environment
Fresh built from master
Linux, tmux 3.4 (also applies to any terminal that supports bracketed paste β right-click / middle-click / Ctrl+Shift+V)
This has been fixed on master in commit 349ec54 ("Block bracketed paste in read-only buffers"): paste_text() now gates buffer-destined bracketed pastes on is_editing_disabled, showing the "Editing disabled in this buffer" message instead of inserting. Closing as fixed.
Activity
Block bracketed paste in read-only buffers
sinelaw commentedon Jul 14, 2026
This has been fixed on
masterin commit 349ec54 ("Block bracketed paste in read-only buffers"):paste_text()now gates buffer-destined bracketed pastes onis_editing_disabled, showing the "Editing disabled in this buffer" message instead of inserting. Closing as fixed.Generated by Claude Code