summaryrefslogtreecommitdiffstats
path: root/tty.c
diff options
context:
space:
mode:
authornicm <nicm>2022-03-08 12:01:19 +0000
committernicm <nicm>2022-03-08 12:01:19 +0000
commitad9b8059836d424f70a8579d28e28e0186cdbaa6 (patch)
tree80599fec37594749c9e5c2d94ccfb68e5e601ea3 /tty.c
parent98cd8e4cad3afbc542de665e9d025d12b560bc6b (diff)
Add argument to refresh-client -l to forward clipboard to a pane. GitHub
issue 3068.
Diffstat (limited to 'tty.c')
-rw-r--r--tty.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tty.c b/tty.c
index 06b1bfb2..40735ceb 100644
--- a/tty.c
+++ b/tty.c
@@ -2921,24 +2921,29 @@ tty_default_attributes(struct tty *tty, const struct grid_cell *defaults,
}
static void
-tty_query_timer_callback(__unused int fd, __unused short events, void *data)
+tty_clipboard_query_callback(__unused int fd, __unused short events, void *data)
{
struct tty *tty = data;
+ struct client *c = tty->client;
+
+ c->flags &= ~CLIENT_CLIPBOARDBUFFER;
+ free(c->clipboard_panes);
+ c->clipboard_panes = NULL;
+ c->clipboard_npanes = 0;
tty->flags &= ~TTY_OSC52QUERY;
}
void
-tty_send_osc52_query(struct tty *tty)
+tty_clipboard_query(struct tty *tty)
{
struct timeval tv = { .tv_sec = TTY_QUERY_TIMEOUT };
if ((~tty->flags & TTY_STARTED) || (tty->flags & TTY_OSC52QUERY))
return;
tty_putcode_ptr2(tty, TTYC_MS, "", "?");
- tty->flags |= TTY_OSC52QUERY;
- evtimer_set(&tty->query_timer, tty_query_timer_callback, tty);
- evtimer_add(&tty->query_timer, &tv);
+ tty->flags |= TTY_OSC52QUERY;
+ evtimer_set(&tty->clipboard_timer, tty_clipboard_query_callback, tty);
+ evtimer_add(&tty->clipboard_timer, &tv);
}
-