aboutsummaryrefslogtreecommitdiff
path: root/osc.c
diff options
context:
space:
mode:
Diffstat (limited to 'osc.c')
-rw-r--r--osc.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/osc.c b/osc.c
index 72f3c366..2c02f53a 100644
--- a/osc.c
+++ b/osc.c
@@ -8,7 +8,7 @@
#include <sys/epoll.h>
#define LOG_MODULE "osc"
-#define LOG_ENABLE_DBG 0
+#define LOG_ENABLE_DBG 1
#include "log.h"
#include "base64.h"
#include "config.h"
@@ -64,6 +64,14 @@ osc_to_clipboard(struct terminal *term, const char *target,
return;
}
+ const bool copy_allowed = term->conf->security.osc52 == OSC52_ENABLED
+ || term->conf->security.osc52 == OSC52_COPY_ENABLED;
+
+ if (!copy_allowed) {
+ LOG_DBG("ignoring copy request: disabled in configuration");
+ return;
+ }
+
char *decoded = base64_decode(base64_data, NULL);
if (decoded == NULL) {
if (errno == EINVAL)
@@ -190,6 +198,13 @@ osc_from_clipboard(struct terminal *term, const char *source)
return;
}
+ const bool paste_allowed = term->conf->security.osc52 == OSC52_ENABLED
+ || term->conf->security.osc52 == OSC52_PASTE_ENABLED;
+ if (!paste_allowed) {
+ LOG_DBG("ignoring paste request: disabled in configuration");
+ return;
+ }
+
/* Use clipboard if no source has been specified */
char src = source[0] == '\0' ? 'c' : 0;
bool from_clipboard = src == 'c';