selection: copy selected text to the target configured by ‘selection-target’

Closes #288
This commit is contained in:
Daniel Eklöf 2021-01-16 11:26:45 +01:00
parent e69ca255b0
commit 07f6b3b1af
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -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