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.
This commit is contained in:
Daniel Eklöf 2026-05-22 11:59:58 +02:00
parent 4b64ed0a49
commit e85209e736
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

6
osc.c
View file

@ -326,6 +326,12 @@ kitty_clipboard_query(struct terminal *term, bool primary)
LOG_DBG("OSC-5522: query mime-types: primary=%d", 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 */ /* Find a seat in which the terminal has focus */
struct seat *seat = term_first_focused_seat(term); struct seat *seat = term_first_focused_seat(term);
if (seat == NULL) { if (seat == NULL) {