st

st

https://git.tonybtw.com/st.git git://git.tonybtw.com/st.git
1,143 bytes raw
1
diff --git a/config.def.h b/config.def.h
2
index 7cfc07c..0f8b406 100644
3
--- a/config.def.h
4
+++ b/config.def.h
5
@@ -43,6 +43,10 @@ static unsigned int tripleclicktimeout = 600;
6
 /* alt screens */
7
 int allowaltscreen = 1;
8
 
9
+/* allow certain non-interactive (insecure) window operations such as:
10
+   setting the clipboard text */
11
+int allowwindowops = 0;
12
+
13
 /*
14
  * draw latency range in ms - from new content/keypress/etc until drawing.
15
  * within this range, st draws when content stops arriving (idle). mostly it's
16
diff --git a/st.c b/st.c
17
index b67152e..a0d728f 100644
18
--- a/st.c
19
+++ b/st.c
20
@@ -1861,7 +1861,7 @@ strhandle(void)
21
 				xsettitle(strescseq.args[1]);
22
 			return;
23
 		case 52:
24
-			if (narg > 2) {
25
+			if (narg > 2 && allowwindowops) {
26
 				dec = base64dec(strescseq.args[2]);
27
 				if (dec) {
28
 					xsetsel(dec);
29
diff --git a/st.h b/st.h
30
index 6e60b78..1e0298a 100644
31
--- a/st.h
32
+++ b/st.h
33
@@ -118,6 +118,7 @@ extern char *stty_args;
34
 extern char *vtiden;
35
 extern wchar_t *worddelimiters;
36
 extern int allowaltscreen;
37
+extern int allowwindowops;
38
 extern char *termname;
39
 extern unsigned int tabspaces;
40
 extern unsigned int defaultfg;