osc: add option to disable OSC-52, partially or fully

Closes #1867
This commit is contained in:
Daniel Eklöf 2024-12-21 06:52:00 +01:00
parent 67bd5dd460
commit e38ec79be1
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
7 changed files with 99 additions and 1 deletions

View file

@ -553,6 +553,22 @@ test_section_main(void)
config_free(&conf);
}
static void
test_section_security(void)
{
struct config conf = {0};
struct context ctx = {.conf = &conf, .section = "security", .path = "unittest"};
test_invalid_key(&ctx, &parse_section_security, "invalid-key");
test_enum(
&ctx, &parse_section_security, "osc52", 4,
(const char*[]){"disabled", "copy-enabled", "paste-enabled", "enabled"},
(int []){OSC52_DISABLED, OSC52_COPY_ENABLED, OSC52_PASTE_ENABLED, OSC52_ENABLED},
(int *)&conf.security.osc52);
config_free(&conf);
}
static void
test_section_bell(void)
{
@ -1407,6 +1423,7 @@ main(int argc, const char *const *argv)
FcInit();
log_init(LOG_COLORIZE_AUTO, false, 0, LOG_CLASS_ERROR);
test_section_main();
test_section_security();
test_section_bell();
test_section_desktop_notifications();
test_section_scrollback();