From 07f6b3b1af2ad9a492efe81c867cd033ae22f12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sat, 16 Jan 2021 11:26:45 +0100 Subject: [PATCH] =?UTF-8?q?selection:=20copy=20selected=20text=20to=20the?= =?UTF-8?q?=20target=20configured=20by=20=E2=80=98selection-target?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #288 --- selection.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/selection.c b/selection.c index 966b6b2a..0c4c6d1b 100644 --- a/selection.c +++ b/selection.c @@ -1017,7 +1017,20 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial) } xassert(term->selection.start.row <= term->selection.end.row); - selection_to_primary(seat, term, serial); + + switch (term->conf->selection_target) { + case SELECTION_TARGET_PRIMARY: + selection_to_primary(seat, term, serial); + break; + case SELECTION_TARGET_CLIPBOARD: + selection_to_clipboard(seat, term, serial); + break; + + case SELECTION_TARGET_BOTH: + selection_to_primary(seat, term, serial); + selection_to_clipboard(seat, term, serial); + break; + } } void