aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-11-19 13:05:31 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-11-19 13:05:31 +0000
commit19803456182a55ca2af67207187d88b9cf33033a (patch)
treeae1be45cec40e6c904d0bb292340ca4447962414
parentdoc: foot.1: fix highlighting of reference to footclient (diff)
osc: copy to/from clipboard: alias 's' to 'p'
'p' means 'primary', while 's' means 'selection'. Thus, a client can now request 'selection' clipboard data and will receive it from the primary selection.
-rw-r--r--osc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/osc.c b/osc.c
index 20bc06b4..c4bb47ab 100644
--- a/osc.c
+++ b/osc.c
@@ -35,6 +35,7 @@ osc_to_clipboard(struct terminal *term, const char *target,
break;
}
+ case 's':
case 'p': {
char *copy = strdup(decoded);
if (!text_to_primary(term, copy, term->wl->input_serial))
@@ -124,11 +125,8 @@ osc_from_clipboard(struct terminal *term, const char *source)
char src = 0;
for (const char *s = source; *s != '\0'; s++) {
- if (*s == 'c') {
- src = 'c';
- break;
- } else if (*s == 'p') {
- src = 'p';
+ if (*s == 'c' || *s == 'p' || *s == 's') {
+ src = *s;
break;
}
}
@@ -150,6 +148,7 @@ osc_from_clipboard(struct terminal *term, const char *source)
&from_clipboard_cb, &from_clipboard_done, ctx);
break;
+ case 's':
case 'p':
text_from_primary(term, &from_clipboard_cb, &from_clipboard_done, ctx);
break;