Note: When using a pipe like "| tee", you'll lose the exit code of the
shell command. This might be configurable by your shell, look for
the pipefail option (for bash and zsh, use ":set -o pipefail").
+ Only a single "%s" value is allowed.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
become obsolete (at least for Unix).
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
+ *E1577*
+ Only a single "%s" item is allowed in the option value.
+
*'shellslash'* *'ssl'* *'noshellslash'* *'nossl'*
'shellslash' 'ssl' boolean (default off)
E1574 channel.txt /*E1574*
E1575 builtin.txt /*E1575*
E1576 tagsrch.txt /*E1576*
+E1577 options.txt /*E1577*
E158 sign.txt /*E158*
E159 sign.txt /*E159*
E16 cmdline.txt /*E16*
#endif
EXTERN char e_tag_file_entry_must_not_be_url[]
INIT(= N_("E1576: Tag file entry must not be a URL"));
+EXTERN char e_invalid_format_string_single_percent_s[]
+ INIT(= N_("E1577: Invalid format string, only one \"%s\" is allowed"));
#undef MAX_SEARCH_COUNT
}
+/*
+ * Validate 'shellpipe'/'shellredir' option.
+ */
+ char *
+did_set_shellpipe_redir(optset_T *args)
+{
+ char_u *p;
+ bool seen = false;
+
+ for (p = args->os_newval.string; *p != NUL; ++p)
+ {
+ if (*p != '%')
+ continue;
+
+ if (p[1] == NUL)
+ return e_invalid_format_string_single_percent_s;
+
+ if (p[1] == '%')
+ {
+ ++p; // skip second %
+ continue;
+ }
+
+ if (p[1] == 's')
+ {
+ if (seen)
+ return e_invalid_format_string_single_percent_s;
+
+ seen = true;
+ ++p; // consume 's'
+ continue;
+ }
+ return e_invalid_format_string_single_percent_s;
+ }
+ return NULL;
+}
+
#if defined(BACKSLASH_IN_FILENAME)
/*
(char_u *)0L} SCTX_INIT},
{"shellpipe", "sp", P_STRING|P_VI_DEF|P_SECURE,
#ifdef FEAT_QUICKFIX
- (char_u *)&p_sp, PV_NONE, NULL, NULL,
+ (char_u *)&p_sp, PV_NONE, did_set_shellpipe_redir, NULL,
{
# if defined(UNIX)
(char_u *)"| tee",
(char_u *)&p_shq, PV_NONE, NULL, NULL,
{(char_u *)"", (char_u *)0L} SCTX_INIT},
{"shellredir", "srr", P_STRING|P_VI_DEF|P_SECURE,
- (char_u *)&p_srr, PV_NONE, NULL, NULL,
+ (char_u *)&p_srr, PV_NONE, did_set_shellpipe_redir, NULL,
{(char_u *)">", (char_u *)0L} SCTX_INIT},
{"shellslash", "ssl", P_BOOL|P_VI_DEF,
#ifdef BACKSLASH_IN_FILENAME
msgstr ""
"Project-Id-Version: Vim\n"
"Report-Msgid-Bugs-To: vim-dev@vim.org\n"
-"POT-Creation-Date: 2026-04-29 19:49+0000\n"
+"POT-Creation-Date: 2026-05-07 19:25+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
msgid "E1576: Tag file entry must not be a URL"
msgstr ""
+#, c-format
+msgid "E1577: Invalid format string, only one \"%s\" is allowed"
+msgstr ""
+
#. type of cmdline window or 0
#. result of cmdline window or 0
#. buffer of cmdline window or NULL
char *did_set_readonly(optset_T *args);
char *did_set_scrollbind(optset_T *args);
char *did_set_maxsearchcount(optset_T *args);
+char *did_set_shellpipe_redir(optset_T *args);
char *did_set_shellslash(optset_T *args);
char *did_set_shiftwidth_tabstop(optset_T *args);
char *did_set_showtabline(optset_T *args);
\ ['selection', 'exclusive', 'a123'],
\ ['selectmode', 'cmd', 'a123'],
\ ['sessionoptions', 'options', 'a123'],
+ \ ['shellpipe', '>%s', "%s%s%s"],
+ \ ['shellredir', '>%s', "%s%s%s"],
\ ['shortmess', 'w', '2'],
\ ['showbreak', '>>', "\x01"],
\ ['showcmdloc', 'statusline', 'a123'],
\ 'sessionoptions': [['', 'blank', 'curdir', 'sesdir',
\ 'help,options,slash'],
\ ['xxx', 'curdir,sesdir']],
+ \ 'shellpipe': [[ '', '>', '>%s2>&1', '\|tee', '\|&tee', '2>&1\|tee', '%%'],
+ \ ['%s%s%s', '%s%p%d']],
+ \ 'shellredir': [[ '', '>', '>%s2>&1', '\|tee', '\|&tee', '2>&1\|tee', '%%'],
+ \ ['%s%s%s', '%s%p%d']],
\ 'showcmdloc': [['', 'last', 'statusline', 'tabline'], ['xxx']],
\ 'signcolumn': [['', 'auto', 'no', 'yes', 'number'], ['xxx', 'no,yes']],
\ 'spellfile': [['', 'file.en.add', 'xxx.en.add,yyy.gb.add,zzz.ja.add',
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 458,
/**/
457,
/**/