Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-06-05 09:15:07 +01:00
3 changed files with 16 additions and 3 deletions

View File

@@ -35,7 +35,7 @@
"," \ "," \
"bind-key #{?key_has_repeat,#{?key_repeat,-r, },} " \ "bind-key #{?key_has_repeat,#{?key_repeat,-r, },} " \
"-T #{p|#{key_table_width}:key_table} " \ "-T #{p|#{key_table_width}:key_table} " \
"#{p|#{key_string_width}:key_string} " \ "#{p|#{key_string_width}:#{q|a:key_string}} " \
"#{key_command}}" "#{key_command}}"
static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *); static enum cmd_retval cmd_list_keys_exec(struct cmd *, struct cmdq_item *);

View File

@@ -116,6 +116,7 @@ format_job_cmp(struct format_job *fj1, struct format_job *fj2)
#define FORMAT_NOT 0x80000 #define FORMAT_NOT 0x80000
#define FORMAT_NOT_NOT 0x100000 #define FORMAT_NOT_NOT 0x100000
#define FORMAT_REPEAT 0x200000 #define FORMAT_REPEAT 0x200000
#define FORMAT_QUOTE_ARGUMENTS 0x400000
/* Limit on recursion. */ /* Limit on recursion. */
#define FORMAT_LOOP_LIMIT 100 #define FORMAT_LOOP_LIMIT 100
@@ -4182,6 +4183,11 @@ found:
found = format_quote_style(saved); found = format_quote_style(saved);
free(saved); free(saved);
} }
if (modifiers & FORMAT_QUOTE_ARGUMENTS) {
saved = found;
found = args_escape(saved);
free(saved);
}
return (found); return (found);
} }
@@ -5155,6 +5161,8 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen,
else if (strchr(fm->argv[0], 'e') != NULL || else if (strchr(fm->argv[0], 'e') != NULL ||
strchr(fm->argv[0], 'h') != NULL) strchr(fm->argv[0], 'h') != NULL)
modifiers |= FORMAT_QUOTE_STYLE; modifiers |= FORMAT_QUOTE_STYLE;
else if (strchr(fm->argv[0], 'a') != NULL)
modifiers |= FORMAT_QUOTE_ARGUMENTS;
break; break;
case 'E': case 'E':
modifiers |= FORMAT_EXPAND; modifiers |= FORMAT_EXPAND;

9
tmux.1
View File

@@ -6288,12 +6288,17 @@ of the variable respectively.
.Ql q:\& .Ql q:\&
will escape will escape
.Xr sh 1 .Xr sh 1
special characters or with a special characters; with a
.Ql h .Ql h
suffix, escape hash characters (so suffix, escape hash characters (so
.Ql # .Ql #
becomes becomes
.Ql ## ) . .Ql ## ) ;
or with
.Ql a
escape
.Nm
command arguments.
.Ql E:\& .Ql E:\&
will expand the format twice, for example will expand the format twice, for example
.Ql #{E:status\-left} .Ql #{E:status\-left}