mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-24 09:05:48 -04:00
osc: implement copy/paste to/from primary
This commit is contained in:
parent
70b6d9d7d2
commit
15afd26716
3 changed files with 113 additions and 70 deletions
11
osc.c
11
osc.c
|
|
@ -65,6 +65,13 @@ osc_to_clipboard(struct terminal *term, const char *target,
|
|||
break;
|
||||
}
|
||||
|
||||
case 'p': {
|
||||
char *copy = strdup(decoded);
|
||||
if (!text_to_primary(term, copy, term->input_serial))
|
||||
free(copy);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
LOG_WARN("unimplemented: clipboard target '%c'", *t);
|
||||
break;
|
||||
|
|
@ -157,9 +164,7 @@ osc_from_clipboard(struct terminal *term, const char *source)
|
|||
break;
|
||||
|
||||
case 'p':
|
||||
LOG_ERR("unimplemented: osc from primary");
|
||||
abort();
|
||||
// text_from_primary(term, term->input_serial, &from_clipboard_cb, &ctx);
|
||||
text_from_primary(term, &from_clipboard_cb, &ctx);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue