diff --git a/options-table.c b/options-table.c index cfe318e12..bbe367cfd 100644 --- a/options-table.c +++ b/options-table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options-table.c,v 1.249 2026/10/05 09:03:11 nicm Exp $ */ +/* $OpenBSD: options-table.c,v 1.250 2026/10/07 12:55:41 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -1778,6 +1778,14 @@ const struct options_table_entry options_table[] = { .text = "Default style of the active pane." }, + { .name = "window-default-command", + .type = OPTIONS_TABLE_STRING, + .scope = OPTIONS_TABLE_WINDOW, + .default_str = "", + .text = "Default command to run in new panes. If set, " + "overrides 'default-command'." + }, + { .name = "window-pane-current-status-format", .type = OPTIONS_TABLE_STRING, .scope = OPTIONS_TABLE_WINDOW, diff --git a/spawn.c b/spawn.c index 70ef27f82..b0d3aedee 100644 --- a/spawn.c +++ b/spawn.c @@ -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 @@ -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; diff --git a/tmux.1 b/tmux.1 index 39e902d4b..dbe537dac 100644 --- a/tmux.1 +++ b/tmux.1 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tmux.1,v 1.1177 2026/10/06 17:45:26 schwarze Exp $ +.\" $OpenBSD: tmux.1,v 1.1178 2026/10/07 12:55:41 nicm Exp $ .\" .\" Copyright (c) 2007 Nicholas Marriott .\" @@ -14,7 +14,7 @@ .\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING .\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: October 6 2026 $ +.Dd $Mdocdate: October 7 2026 $ .Dt TMUX 1 .Os .Sh NAME @@ -3619,6 +3619,8 @@ is the command to execute. If .Ar shell\-command is not specified, the value of the +.Ic window\-default\-command +or .Ic default\-command option is used. .Fl c @@ -6179,6 +6181,11 @@ see the .Sx STYLES section. .Pp +.It Ic window\-default\-command Ar shell\-command +Per-window version of the +.Ic default\-command +option. +.Pp .It Ic window\-status\-activity\-style Ar style Set status line style for windows with an activity alert. For how to specify