diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-01-16 10:26:45 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-02-12 09:55:40 +0000 |
| commit | 76e8d3f483802934e1f87b7c9ef11577b703c590 (patch) | |
| tree | db75aa14e7652537ee664a0f25108451fc1e236a | |
| parent | config: add new option ‘selection-target’ (diff) | |
selection: copy selected text to the target configured by ‘selection-target’
Closes #288
| -rw-r--r-- | selection.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/selection.c b/selection.c index b83331a6..fd1b1661 100644 --- a/selection.c +++ b/selection.c @@ -655,7 +655,20 @@ selection_finalize(struct seat *seat, struct terminal *term, uint32_t serial) } assert(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 |
