Add window-default-command option to override default-command per

window, from Meriel Sartha Mittelbach.
This commit is contained in:
nicm
2026-10-07 12:55:41 +00:00
committed by tmux update bot
parent e63e2df764
commit d041d56bb2
3 changed files with 22 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: spawn.c,v 1.54 2026/10/02 13:20:42 nicm Exp $ */
/* $OpenBSD: spawn.c,v 1.55 2026/10/07 12:55:41 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -379,7 +379,9 @@ spawn_pane(struct spawn_context *sc, char **cause)
* directory.
*/
if (sc->argc == 0 && (~sc->flags & SPAWN_RESPAWN)) {
cmd = options_get_string(s->options, "default-command");
cmd = options_get_string(w->options, "window-default-command");
if (cmd == NULL || *cmd == '\0')
cmd = options_get_string(s->options, "default-command");
if (cmd != NULL && *cmd != '\0') {
argc = 1;
argv = (char **)&cmd;