mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
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.
This commit is contained in:
parent
e8c0bf6350
commit
1980345618
1 changed files with 4 additions and 5 deletions
9
osc.c
9
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue