From c366e322eb0813253fb08e2720927f26563a09f8 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 15 May 2026 18:35:51 +0200 Subject: osc: implement OSC-5522, kitty's extended version of OSC-52 OSC-5522[^1] gives the terminal application access to all offered mime-types when reading the clipboard, and allows setting multiple mime-types when writing to the clipboard (with different contents, if it so wishes). In addition to the base protocol, we also implement the _event extension_[^2], where a paste action (e.g. ctrl+shift+v) results in an unsolicited mime-type listing being sent to the terminal application (as if it had issued a mime-type query itself), instead of the clipboard content being pasted directly. The application follows up with an explicit read request (or chooses to ignore the event). The protocol supports "passwords", as a way of bypassing terminal popups asking the user for approval, after the first popup has been approved by the user. Foot doesn't implement this kind of user approval, but all read and write requests are denied with EPERM if the user has disabled OSC copy/pasting with the security.osc52 configuration option. In addition, if disabled, event reporting cannot be enabled at all (i.e. 'CSI ? 5522 h' is ignored). [^1]: https://sw.kovidgoyal.net/kitty/clipboard/ [^2]: https://rockorager.dev/misc/bracketed-paste-mime/ --- render.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index cf5f969a..c04ce9f8 100644 --- a/render.c +++ b/render.c @@ -3734,13 +3734,7 @@ render_search_box(struct terminal *term) #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED /* TODO: do we want to/need to handle multi-seat? */ - struct seat *ime_seat = NULL; - tll_foreach(term->wl->seats, it) { - if (it->item.kbd_focus == term) { - ime_seat = &it->item; - break; - } - } + struct seat *ime_seat = term_first_focused_seat(term); size_t text_len = term->search.len; if (ime_seat != NULL && ime_seat->ime.preedit.text != NULL) -- cgit v1.3