Merge remote-tracking branch 'refs/remotes/tmux-openbsd/master'

* refs/remotes/tmux-openbsd/master:
  Include menus when working out what parts of a pane are visible to avoid overwriting them, GitHub issue 5593.
  Modify display-message -c target-client to use the data relative to target-client, GitHub issue 5613 from Michael Grant.
  Quote session_alert in status-format[2], GitHub issue 5671.
  Only skip collecting text except for right margin when autowrap is off, from Jang-Ho Hwang.
  Change to the new working directory even if getcwd fails, GitHub issue 5658.
This commit is contained in:
tmux update bot
2026-10-02 19:21:31 +00:00
5 changed files with 128 additions and 115 deletions

18
spawn.c
View File

@@ -1,4 +1,4 @@
/* $OpenBSD: spawn.c,v 1.53 2026/09/21 12:43:36 nicm Exp $ */
/* $OpenBSD: spawn.c,v 1.54 2026/10/02 13:20:42 nicm Exp $ */
/*
* Copyright (c) 2019 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -465,14 +465,14 @@ spawn_pane(struct spawn_context *sc, char **cause)
new_wp->flags &= ~PANE_EMPTY;
/* Store current working directory and change to new one. */
if (getcwd(path, sizeof path) != NULL) {
if (chdir(new_wp->cwd) == 0)
actual_cwd = new_wp->cwd;
else if (home != NULL && chdir(home) == 0)
actual_cwd = home;
else if (chdir("/") == 0)
actual_cwd = "/";
}
if (getcwd(path, sizeof path) == NULL)
strlcpy(path, "/", sizeof path);
if (chdir(new_wp->cwd) == 0)
actual_cwd = new_wp->cwd;
else if (home != NULL && chdir(home) == 0)
actual_cwd = home;
else if (chdir("/") == 0)
actual_cwd = "/";
/* Fork the new process. */
new_wp->pid = fdforkpty(ptm_fd, &new_wp->fd, new_wp->tty, NULL, &ws);