mirror of
https://github.com/tmate-io/tmate
synced 2020-11-18 19:53:50 -08:00
copy mode uses the real screen as backing and if it is updated while copying,
strange things can happen. So, freeze reading from the pty while in copy mode.
This commit is contained in:
@ -69,7 +69,9 @@ server_window_loop(void)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
TAILQ_FOREACH(wp, &w->panes, entry) {
|
TAILQ_FOREACH(wp, &w->panes, entry) {
|
||||||
if (wp->fd != -1) {
|
if (wp->fd == -1)
|
||||||
|
continue;
|
||||||
|
if (!(wp->flags & PANE_FREEZE)) {
|
||||||
if (server_window_backoff(wp))
|
if (server_window_backoff(wp))
|
||||||
bufferevent_disable(wp->event, EV_READ);
|
bufferevent_disable(wp->event, EV_READ);
|
||||||
else
|
else
|
||||||
|
1
tmux.h
1
tmux.h
@ -787,6 +787,7 @@ struct window_pane {
|
|||||||
|
|
||||||
int flags;
|
int flags;
|
||||||
#define PANE_REDRAW 0x1
|
#define PANE_REDRAW 0x1
|
||||||
|
#define PANE_FREEZE 0x2
|
||||||
|
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char *shell;
|
char *shell;
|
||||||
|
@ -138,6 +138,9 @@ window_copy_init(struct window_pane *wp)
|
|||||||
data->searchtype = WINDOW_COPY_OFF;
|
data->searchtype = WINDOW_COPY_OFF;
|
||||||
data->searchstr = NULL;
|
data->searchstr = NULL;
|
||||||
|
|
||||||
|
wp->flags |= PANE_FREEZE;
|
||||||
|
bufferevent_disable(wp->event, EV_READ|EV_WRITE);
|
||||||
|
|
||||||
s = &data->screen;
|
s = &data->screen;
|
||||||
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);
|
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);
|
||||||
if (options_get_number(&wp->window->options, "mode-mouse"))
|
if (options_get_number(&wp->window->options, "mode-mouse"))
|
||||||
@ -166,6 +169,9 @@ window_copy_free(struct window_pane *wp)
|
|||||||
{
|
{
|
||||||
struct window_copy_mode_data *data = wp->modedata;
|
struct window_copy_mode_data *data = wp->modedata;
|
||||||
|
|
||||||
|
wp->flags &= ~PANE_FREEZE;
|
||||||
|
bufferevent_enable(wp->event, EV_READ|EV_WRITE);
|
||||||
|
|
||||||
if (data->searchstr != NULL)
|
if (data->searchstr != NULL)
|
||||||
xfree(data->searchstr);
|
xfree(data->searchstr);
|
||||||
xfree(data->inputstr);
|
xfree(data->inputstr);
|
||||||
|
Reference in New Issue
Block a user