Add -E to new-window and respawn-pane and respawn-window to create empty

panes.
This commit is contained in:
nicm
2026-07-03 16:09:49 +00:00
parent 6967f54774
commit 820067826a
4 changed files with 30 additions and 10 deletions

13
spawn.c
View File

@@ -266,14 +266,20 @@ spawn_pane(struct spawn_context *sc, char **cause)
free(cwd);
return (NULL);
}
if (sc->wp0->fd != -1) {
if (sc->wp0->event != NULL) {
bufferevent_free(sc->wp0->event);
sc->wp0->event = NULL;
}
if (sc->wp0->fd != -1) {
close(sc->wp0->fd);
sc->wp0->fd = -1;
}
window_pane_reset_mode_all(sc->wp0);
screen_reinit(&sc->wp0->base);
input_free(sc->wp0->ictx);
sc->wp0->ictx = NULL;
if (sc->wp0->ictx != NULL) {
input_free(sc->wp0->ictx);
sc->wp0->ictx = NULL;
}
new_wp = sc->wp0;
new_wp->flags &= ~(PANE_STATUSREADY|PANE_STATUSDRAWN);
} else {
@@ -389,6 +395,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
new_wp->base.mode |= MODE_CRLF;
goto complete;
}
new_wp->flags &= ~PANE_EMPTY;
/* Store current working directory and change to new one. */
if (getcwd(path, sizeof path) != NULL) {