From 19803456182a55ca2af67207187d88b9cf33033a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 19 Nov 2019 14:05:31 +0100 Subject: [PATCH] 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. --- osc.c | 9 ++++----- 1 file 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;