mirror of
https://github.com/tmux/tmux.git
synced 2026-10-07 10:14:28 +00:00
When a pane is respawned, reset the control mode offsets. GitHub issue
5498 from Alex Rattray.
This commit is contained in:
18
spawn.c
18
spawn.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: spawn.c,v 1.50 2026/07/23 09:38:27 nicm Exp $ */
|
||||
/* $OpenBSD: spawn.c,v 1.51 2026/08/18 07:43:44 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -245,7 +245,7 @@ struct window_pane *
|
||||
spawn_pane(struct spawn_context *sc, char **cause)
|
||||
{
|
||||
struct cmdq_item *item = sc->item;
|
||||
struct client *c;
|
||||
struct client *c, *loop;
|
||||
struct session *s = sc->s;
|
||||
struct session *ts;
|
||||
struct window *w = sc->wl->window;
|
||||
@@ -333,6 +333,20 @@ spawn_pane(struct spawn_context *sc, char **cause)
|
||||
input_free(sc->wp0->ictx);
|
||||
sc->wp0->ictx = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The old buffer is gone and the new one starts empty, so
|
||||
* offsets into the old buffer no longer mean anything. Reset
|
||||
* them, and drop output control clients still had queued.
|
||||
*/
|
||||
sc->wp0->offset.used = 0;
|
||||
sc->wp0->base_offset = 0;
|
||||
sc->wp0->pipe_offset.used = 0;
|
||||
TAILQ_FOREACH(loop, &clients, entry) {
|
||||
if (loop->flags & CLIENT_CONTROL)
|
||||
control_reset_pane(loop, sc->wp0);
|
||||
}
|
||||
|
||||
new_wp = sc->wp0;
|
||||
new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user