diff options
author | nicm <nicm> | 2022-03-08 12:01:19 +0000 |
---|---|---|
committer | nicm <nicm> | 2022-03-08 12:01:19 +0000 |
commit | ad9b8059836d424f70a8579d28e28e0186cdbaa6 (patch) | |
tree | 80599fec37594749c9e5c2d94ccfb68e5e601ea3 /tty.c | |
parent | 98cd8e4cad3afbc542de665e9d025d12b560bc6b (diff) | |
download | rtmux-ad9b8059836d424f70a8579d28e28e0186cdbaa6.tar.gz rtmux-ad9b8059836d424f70a8579d28e28e0186cdbaa6.tar.bz2 rtmux-ad9b8059836d424f70a8579d28e28e0186cdbaa6.zip |
Add argument to refresh-client -l to forward clipboard to a pane. GitHub
issue 3068.
Diffstat (limited to 'tty.c')
-rw-r--r-- | tty.c | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -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); } - |