mirror of
https://github.com/tmux/tmux.git
synced 2024-12-26 03:19:16 +00:00
Do not write bracketed paste keys themselves if the pane has not asked
for them.
This commit is contained in:
parent
6d792e4123
commit
102f34090d
@ -2581,7 +2581,7 @@ paste_key:
|
||||
if (c->flags & CLIENT_READONLY)
|
||||
goto out;
|
||||
if (event->buf != NULL)
|
||||
window_pane_paste(wp, event->buf, event->len);
|
||||
window_pane_paste(wp, key, event->buf, event->len);
|
||||
key = KEYC_NONE;
|
||||
goto out;
|
||||
|
||||
|
7
tmux.h
7
tmux.h
@ -165,6 +165,10 @@ struct winlink;
|
||||
(((key) & KEYC_MASK_KEY) < KEYC_USER || \
|
||||
((key) & KEYC_MASK_KEY) >= KEYC_USER_END))
|
||||
|
||||
/* Is this a paste key? */
|
||||
#define KEYC_IS_PASTE(key) \
|
||||
((key) == KEYC_PASTE_START || (key) == KEYC_PASTE_END)
|
||||
|
||||
/* Multiple click timeout. */
|
||||
#define KEYC_CLICK_TIMEOUT 300
|
||||
|
||||
@ -3160,7 +3164,8 @@ void window_pane_reset_mode_all(struct window_pane *);
|
||||
int window_pane_key(struct window_pane *, struct client *,
|
||||
struct session *, struct winlink *, key_code,
|
||||
struct mouse_event *);
|
||||
void window_pane_paste(struct window_pane *, char *, size_t);
|
||||
void window_pane_paste(struct window_pane *, key_code, char *,
|
||||
size_t);
|
||||
int window_pane_visible(struct window_pane *);
|
||||
int window_pane_exited(struct window_pane *);
|
||||
u_int window_pane_search(struct window_pane *, const char *, int,
|
||||
|
5
window.c
5
window.c
@ -1219,7 +1219,7 @@ window_pane_copy_key(struct window_pane *wp, key_code key)
|
||||
}
|
||||
|
||||
void
|
||||
window_pane_paste(struct window_pane *wp, char *buf, size_t len)
|
||||
window_pane_paste(struct window_pane *wp, key_code key, char *buf, size_t len)
|
||||
{
|
||||
if (!TAILQ_EMPTY(&wp->modes))
|
||||
return;
|
||||
@ -1227,6 +1227,9 @@ window_pane_paste(struct window_pane *wp, char *buf, size_t len)
|
||||
if (wp->fd == -1 || wp->flags & PANE_INPUTOFF)
|
||||
return;
|
||||
|
||||
if (KEYC_IS_PASTE(key) && (~wp->screen->mode & MODE_BRACKETPASTE))
|
||||
return;
|
||||
|
||||
log_debug("%s: %.*s", __func__, (int)len, buf);
|
||||
bufferevent_write(wp->event, buf, len);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user