Ignore default-shell (and use /bin/sh) if it invalid not just if it is

tmux itself, also refuse to set the option to something invalid in the
first place. GitHub issue 2120.
This commit is contained in:
nicm
2020-03-17 11:10:12 +00:00
parent fb396286ff
commit 115bb33257
5 changed files with 15 additions and 6 deletions

View File

@ -320,7 +320,7 @@ spawn_pane(struct spawn_context *sc, char **cause)
/* Then the shell. If respawning, use the old one. */
if (~sc->flags & SPAWN_RESPAWN) {
tmp = options_get_string(s->options, "default-shell");
if (*tmp == '\0' || areshell(tmp))
if (!checkshell(tmp))
tmp = _PATH_BSHELL;
free(new_wp->shell);
new_wp->shell = xstrdup(tmp);