From b04f8acb7057bda74e30976acedbbd73767e5bdc Mon Sep 17 00:00:00 2001 From: nicm Date: Fri, 19 Feb 2021 09:09:16 +0000 Subject: Check return value of chdir() to stop a silly warning with some compilers, GitHub issue 2573. --- spawn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'spawn.c') diff --git a/spawn.c b/spawn.c index d5b52ffa..41ffe612 100644 --- a/spawn.c +++ b/spawn.c @@ -379,10 +379,10 @@ spawn_pane(struct spawn_context *sc, char **cause) * Child process. Change to the working directory or home if that * fails. */ - if (chdir(new_wp->cwd) != 0) { - if ((tmp = find_home()) == NULL || chdir(tmp) != 0) - chdir("/"); - } + if (chdir(new_wp->cwd) != 0 && + ((tmp = find_home()) == NULL || chdir(tmp) != 0) && + chdir("/") != 0) + fatal("chdir failed"); /* * Update terminal escape characters from the session if available and -- cgit From c44750792a9683c5cd6f9df5a69e7417b88772d2 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 2 Mar 2021 10:56:45 +0000 Subject: Drop support for popups where the content is provided directly to tmux (which does not have many practical uses) and only support running a program in the popup. display-popup is now simpler and can accept multiple arguments to avoid escaping problems (like the other commands). --- spawn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'spawn.c') diff --git a/spawn.c b/spawn.c index 41ffe612..9a801a38 100644 --- a/spawn.c +++ b/spawn.c @@ -265,8 +265,9 @@ spawn_pane(struct spawn_context *sc, char **cause) } /* - * Now we have a pane with nothing running in it ready for the new process. - * Work out the command and arguments and store the working directory. + * Now we have a pane with nothing running in it ready for the new + * process. Work out the command and arguments and store the working + * directory. */ if (sc->argc == 0 && (~sc->flags & SPAWN_RESPAWN)) { cmd = options_get_string(s->options, "default-command"); -- cgit From 81f9a23d25237f2b0c52a2867ddd2db59cc8f368 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 2 Mar 2021 11:00:38 +0000 Subject: Do not use NULL active window; also do not leak window name. GitHub issue 2590 from Chester Liu. --- spawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spawn.c') diff --git a/spawn.c b/spawn.c index 9a801a38..e3f8debe 100644 --- a/spawn.c +++ b/spawn.c @@ -184,7 +184,7 @@ spawn_window(struct spawn_context *sc, char **cause) NULL); options_set_number(w->options, "automatic-rename", 0); } else - w->name = xstrdup(default_window_name(w)); + w->name = default_window_name(w); } /* Switch to the new window if required. */ -- cgit