mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 14:27:09 +00:00
Sync OpenBSD patchset 648:
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:
@ -1,4 +1,4 @@
|
||||
/* $Id: window-copy.c,v 1.104 2010-02-18 12:38:24 tcunha Exp $ */
|
||||
/* $Id: window-copy.c,v 1.105 2010-02-26 13:26:44 tcunha Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -138,6 +138,9 @@ window_copy_init(struct window_pane *wp)
|
||||
data->searchtype = WINDOW_COPY_OFF;
|
||||
data->searchstr = NULL;
|
||||
|
||||
wp->flags |= PANE_FREEZE;
|
||||
bufferevent_disable(wp->event, EV_READ|EV_WRITE);
|
||||
|
||||
s = &data->screen;
|
||||
screen_init(s, screen_size_x(&wp->base), screen_size_y(&wp->base), 0);
|
||||
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;
|
||||
|
||||
wp->flags &= ~PANE_FREEZE;
|
||||
bufferevent_enable(wp->event, EV_READ|EV_WRITE);
|
||||
|
||||
if (data->searchstr != NULL)
|
||||
xfree(data->searchstr);
|
||||
xfree(data->inputstr);
|
||||
|
Reference in New Issue
Block a user