From 76f5d3364c8d822989adbf0d3f7bc7c27981110b Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 Oct 2021 18:39:15 +0000 Subject: [PATCH 1/3] Expand command as a format, GitHub issue 2920. --- cmd-confirm-before.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd-confirm-before.c b/cmd-confirm-before.c index 95841962..ce8c95e0 100644 --- a/cmd-confirm-before.c +++ b/cmd-confirm-before.c @@ -72,7 +72,7 @@ cmd_confirm_before_exec(struct cmd *self, struct cmdq_item *item) int wait = !args_has(args, 'b'); cdata = xcalloc(1, sizeof *cdata); - cdata->cmdlist = args_make_commands_now(self, item, 0, 0); + cdata->cmdlist = args_make_commands_now(self, item, 0, 1); if (cdata->cmdlist == NULL) return (CMD_RETURN_ERROR); From 49d33a4282dad9245cc644b9259b40ae94bc0063 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 Oct 2021 18:54:33 +0000 Subject: [PATCH 2/3] Allow detach even if suspend flag set, GitHub issue 2932. --- server-client.c | 2 +- tmux.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/server-client.c b/server-client.c index dc5074e7..7cea32c0 100644 --- a/server-client.c +++ b/server-client.c @@ -516,7 +516,7 @@ server_client_detach(struct client *c, enum msgtype msgtype) { struct session *s = c->session; - if (s == NULL || (c->flags & CLIENT_UNATTACHEDFLAGS)) + if (s == NULL || (c->flags & CLIENT_NODETACHFLAGS)) return; c->flags |= CLIENT_EXIT; diff --git a/tmux.h b/tmux.h index 0d3c923f..59e1687d 100644 --- a/tmux.h +++ b/tmux.h @@ -1710,6 +1710,9 @@ struct client { (CLIENT_DEAD| \ CLIENT_SUSPENDED| \ CLIENT_EXIT) +#define CLIENT_NODETACHFLAGS \ + (CLIENT_DEAD| \ + CLIENT_EXIT) #define CLIENT_NOSIZEFLAGS \ (CLIENT_DEAD| \ CLIENT_SUSPENDED| \ From 4acad43013b7bb5f91103a68cfce591b1980ae17 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 28 Oct 2021 18:57:06 +0000 Subject: [PATCH 3/3] Do not force the cursor to move if it is in the automargin space at EOL and that is where we want it to be, GitHub issue 2956. --- tty.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tty.c b/tty.c index 243eae56..62298a54 100644 --- a/tty.c +++ b/tty.c @@ -2278,17 +2278,25 @@ tty_cursor(struct tty *tty, u_int cx, u_int cy) if (tty->flags & TTY_BLOCK) return; - if (cx > tty->sx - 1) - cx = tty->sx - 1; - thisx = tty->cx; thisy = tty->cy; + /* + * If in the automargin space, and want to be there, do not move. + * Otherwise, force the cursor to be in range (and complain). + */ + if (cx == thisx && cy == thisy && cx == tty->sx) + return; + if (cx > tty->sx - 1) { + log_debug("%s: x too big %u > %u", __func__, cx, tty->sx - 1); + cx = tty->sx - 1; + } + /* No change. */ if (cx == thisx && cy == thisy) return; - /* Very end of the line, just use absolute movement. */ + /* Currently at the very end of the line - use absolute movement. */ if (thisx > tty->sx - 1) goto absolute;