Confirm unsafe pastes and programs' clipboard access #17
Labels
No labels
needs-info
needs-triage
ready-for-agent
ready-for-human
wayfinder:map
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jeff/harrier#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ask before an unsafe paste, and before a program's clipboard access, with a confirmation: an overlay over the pane it concerns. The terms are in GLOSSARY.md.
Today
Window.paste(src/Window.zig, thes.stream.handler.pastecall) and drag and drop (src/Dnd.zig) both passallow_unsafe = true, so a line break in pasted text reaches a program without bracketed paste as Enter.ESC [201~cannot end bracketed paste early, and control characters never arrive.Session.clipboardWrite, src/termio/Session.zig). OSC 52 reads are not supported: harrier never sets theclipboard_readeffect.Unsafe paste
ESC [201~under bracketed paste does not count, because the ESC is already a space by then.paste), shift+insert (paste_selection), middle-click, and drag and drop. Pastes into the profile selector and the search field are not checked; they drop control characters already.Clipboard access
.ask, the confirmation names the pane, and the machine when the program is on another one, and offers Allow, Allow for this pane, and Deny. Deny is the default..deny: the reply is empty (ESC ] 52 ; c ; ESC \), as xterm's is, so a program waiting for a reply gets one..allow. On.ask, the same three answers, the confirmation showing the text to be written. A write denied is dropped; OSC 52 has no reply for one.c,p,s) is honored as it is for writes now.The confirmation
Settings
A profile may set
clipboard_readandclipboard_write, overridingclipboard.readandclipboard.writefor its panes, the way it setsbell_sound.confirm_unsafe_pasteis global only: it is about the user, not about the program.Not in this
Kitty's clipboard protocol (mode 5522), which reading would make possible: a separate issue.
Done looks like
Session.clipboardWrite)..denyanswers without asking.