From e570146c07b43ffacde6518e35b734b87095ed56 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 22 Aug 2020 09:14:18 +0200 Subject: selection: block non-paste data from being sent to client while pasting While pasting data from the clipboard, block *all* other data from being sent to the client. This includes keyboard and mouse events, but also replies for VT queries. This is particularly important when bracketed paste has been enabled, since then the client will interpret *everything* between the bracketed paste start and end as paste data. --- terminal.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index d1235c2f..4318f889 100644 --- a/terminal.h +++ b/terminal.h @@ -205,6 +205,8 @@ enum term_surface { TERM_SURF_BUTTON_CLOSE, }; +typedef tll(struct ptmx_buffer) ptmx_buffer_list_t; + struct terminal { struct fdm *fdm; struct reaper *reaper; @@ -226,7 +228,9 @@ struct terminal { float font_dpi; enum fcft_subpixel font_subpixel; - tll(struct ptmx_buffer) ptmx_buffer; + bool is_sending_paste_data; + ptmx_buffer_list_t ptmx_buffers; + ptmx_buffer_list_t ptmx_paste_buffers; enum cursor_origin origin; enum cursor_keys cursor_keys_mode; @@ -489,6 +493,8 @@ int term_destroy(struct terminal *term); void term_reset(struct terminal *term, bool hard); bool term_to_slave(struct terminal *term, const void *data, size_t len); +bool term_paste_data_to_slave( + struct terminal *term, const void *data, size_t len); bool term_font_size_increase(struct terminal *term); bool term_font_size_decrease(struct terminal *term); -- cgit v1.3