From ae3eba6e08a8ff36a63b328880d4a97f21e1108b Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 27 May 2019 12:48:52 +0000 Subject: Fix crash when killing the current window, reported by Jesus Rafael Sanchez in GitHub issue 1760. --- spawn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spawn.c b/spawn.c index 986a1e9d..bae220e1 100644 --- a/spawn.c +++ b/spawn.c @@ -161,6 +161,8 @@ spawn_window(struct spawn_context *sc, char **cause) xasprintf(cause, "couldn't create window %d", idx); return (NULL); } + if (s->curw == NULL) + s->curw = sc->wl; sc->wl->session = s; winlink_set_window(sc->wl, w); } else -- cgit v1.2.3