From e85209e73616541a64934661540577aa090d242a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 22 May 2026 11:59:58 +0200 Subject: [PATCH] osc: kitty_clipboard_query(): reply with EPERM if OSC pasting has been disabled This is already being done in when reading and writing the clipboard, but we had missed the query code path. --- osc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/osc.c b/osc.c index ff126285..f8179b3a 100644 --- a/osc.c +++ b/osc.c @@ -326,6 +326,12 @@ kitty_clipboard_query(struct terminal *term, bool primary) LOG_DBG("OSC-5522: query mime-types: primary=%d", primary); + if (!term_osc_paste_allowed(term)) { + LOG_DBG("OSC-5522: ignoring paste request: disabled in configuration"); + term_to_slave(term, "\033]5522;type=read:status=EPERM\033\\", 31); + return; + } + /* Find a seat in which the terminal has focus */ struct seat *seat = term_first_focused_seat(term); if (seat == NULL) {