From 68f2ac92960f76f9ef25f3772b8c11848c55c55d Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 24 Apr 2025 08:54:40 +0000 Subject: [PATCH 1/2] Fix examples with too many backslashes, pointed out by David Mandelberg. --- tmux.1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tmux.1 b/tmux.1 index c7ac6091..ed61ced7 100644 --- a/tmux.1 +++ b/tmux.1 @@ -568,7 +568,7 @@ For this typically means quoted (such as .Ql neww \[aq];\[aq] splitw ) or escaped (such as -.Ql neww \e\e\e\e; splitw ) . +.Ql neww \e; splitw ) . .It Individual semicolons or trailing semicolons that should be interpreted as arguments should be escaped twice: once according to the shell conventions and @@ -576,15 +576,15 @@ a second time for .Nm ; for example: .Bd -literal -offset indent -$ tmux neww \[aq]foo\e\e;\[aq] bar -$ tmux neww foo\e\e\e\e; bar +$ tmux neww \[aq]foo\e;\[aq] bar +$ tmux neww foo\e\e\e; bar .Ed .It Semicolons that are not individual tokens or trailing another token should only be escaped once according to shell conventions; for example: .Bd -literal -offset indent $ tmux neww \[aq]foo-;-bar\[aq] -$ tmux neww foo-\e\e;-bar +$ tmux neww foo-\e;-bar .Ed .El .Pp From f53fac1b56bde6f4861b97d34a2988c2482f3b4a Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 24 Apr 2025 08:55:40 +0000 Subject: [PATCH 2/2] Do not add a trailing / if there is nothing to follow it, Johannes Altmanninger in GitHub issue 4472. --- spawn.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spawn.c b/spawn.c index 7ae3f938..d06d3969 100644 --- a/spawn.c +++ b/spawn.c @@ -231,8 +231,9 @@ spawn_pane(struct spawn_context *sc, char **cause) if (sc->cwd != NULL) { cwd = format_single(item, sc->cwd, c, target->s, NULL, NULL); if (*cwd != '/') { - xasprintf(&new_cwd, "%s/%s", server_client_get_cwd(c, - target->s), cwd); + xasprintf(&new_cwd, "%s%s%s", + server_client_get_cwd(c, target->s), + *cwd != '\0' ? "/" : "", cwd); free(cwd); cwd = new_cwd; }