From 1a419609e37e6b41ad8c1466afa02cfcd6869df8 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 29 Oct 2025 09:33:20 +0000 Subject: [PATCH 1/2] Don't enter copy mode on mouse wheel in alternate screen, GitHub issue 3705. --- key-bindings.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/key-bindings.c b/key-bindings.c index 1fb8189e..7f8b20e0 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -441,10 +441,10 @@ key_bindings_init(void) "bind -n MouseDown1Pane { select-pane -t=; send -M }", /* Mouse button 1 drag on pane. */ - "bind -n MouseDrag1Pane { if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -M } }", + "bind -n MouseDrag1Pane { if -F '#{||:#{alternate_on},#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -M } }", /* Mouse wheel up on pane. */ - "bind -n WheelUpPane { if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -e } }", + "bind -n WheelUpPane { if -F '#{||:#{alternate_on},#{pane_in_mode},#{mouse_any_flag}}' { send -M } { copy-mode -e } }", /* Mouse button 2 down on pane. */ "bind -n MouseDown2Pane { select-pane -t=; if -F '#{||:#{pane_in_mode},#{mouse_any_flag}}' { send -M } { paste -p } }", From 2c08960f4e54dae97327eb7b78c21245abb368cb Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 29 Oct 2025 09:37:36 +0000 Subject: [PATCH 2/2] Add -l flag to command-prompt to disable splitting into multiple prompts, GitHub issue 4483. --- cmd-command-prompt.c | 46 +++++++++++++++++++++++++------------------- tmux.1 | 12 ++++++++++-- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/cmd-command-prompt.c b/cmd-command-prompt.c index 36a1f03c..85a1bf8a 100644 --- a/cmd-command-prompt.c +++ b/cmd-command-prompt.c @@ -42,8 +42,8 @@ const struct cmd_entry cmd_command_prompt_entry = { .name = "command-prompt", .alias = NULL, - .args = { "1bFkiI:Np:t:T:", 0, 1, cmd_command_prompt_args_parse }, - .usage = "[-1bFkiN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE + .args = { "1bFkliI:Np:t:T:", 0, 1, cmd_command_prompt_args_parse }, + .usage = "[-1bFkliN] [-I inputs] [-p prompts] " CMD_TARGET_CLIENT_USAGE " [-T prompt-type] [template]", .flags = CMD_CLIENT_TFLAG, @@ -117,27 +117,33 @@ cmd_command_prompt_exec(struct cmd *self, struct cmdq_item *item) next_input = inputs = xstrdup(s); else next_input = NULL; - while ((prompt = strsep(&next_prompt, ",")) != NULL) { - cdata->prompts = xreallocarray(cdata->prompts, cdata->count + 1, - sizeof *cdata->prompts); - if (!space) - tmp = xstrdup(prompt); - else - xasprintf(&tmp, "%s ", prompt); - cdata->prompts[cdata->count].prompt = tmp; + if (args_has(args, 'l')) { + cdata->prompts = xcalloc(1, sizeof *cdata->prompts); + cdata->prompts[0].prompt = prompts; + cdata->prompts[0].input = inputs; + cdata->count = 1; + } else { + while ((prompt = strsep(&next_prompt, ",")) != NULL) { + cdata->prompts = xreallocarray(cdata->prompts, + cdata->count + 1, sizeof *cdata->prompts); + if (!space) + tmp = xstrdup(prompt); + else + xasprintf(&tmp, "%s ", prompt); + cdata->prompts[cdata->count].prompt = tmp; - if (next_input != NULL) { - input = strsep(&next_input, ","); - if (input == NULL) + if (next_input != NULL) { + input = strsep(&next_input, ","); + if (input == NULL) + input = ""; + } else input = ""; - } else - input = ""; - cdata->prompts[cdata->count].input = xstrdup(input); - - cdata->count++; + cdata->prompts[cdata->count].input = xstrdup(input); + cdata->count++; + } + free(inputs); + free(prompts); } - free(inputs); - free(prompts); if ((type = args_get(args, 'T')) != NULL) { cdata->prompt_type = status_prompt_type(type); diff --git a/tmux.1 b/tmux.1 index c483499e..f6b630dd 100644 --- a/tmux.1 +++ b/tmux.1 @@ -6670,7 +6670,7 @@ See for possible values for .Ar prompt-type . .It Xo Ic command-prompt -.Op Fl 1bFikN +.Op Fl 1bFiklN .Op Fl I Ar inputs .Op Fl p Ar prompts .Op Fl t Ar target-client @@ -6690,8 +6690,10 @@ With .Ar template is expanded as a format. .Pp -If present, +If .Fl I +is present, +.Ar inputs is a comma-separated list of the initial text for each prompt. If .Fl p @@ -6703,6 +6705,12 @@ a single prompt is displayed, constructed from if it is present, or .Ql \&: if not. +.Fl l +disables splitting of +.Ar inputs +and +.Ar prompts +at commas and treats them literally. .Pp Before the command is executed, the first occurrence of the string .Ql %%