fish-shell/src
Johannes Altmanninger e40eba3585 Treat text following quoted command substitution as quoted
Commit ec3d3a481 (Support "$(cmd)" command substitution without line
splitting, 2021-07-02) started treating an input string like
"a$()b" as if it were "a"$()"b". Yet, we do not actually insert the
virtual quotes. Instead we just adapted the definition of when quotes
are closed - hence the changes to quote_end().

parse_util_locate_cmdsubst_range() is aware
of the changes to quote_end() but some of its
callers like parse_util_detect_errors_in_argument() and
highlighter_t::color_as_argument() are not.  They split strings at
command substitution boundaries without handling the special quoting
rules. (Only the expansion logic did it right.)

Fix this by handling the special quoting rules inside
parse_util_locate_cmdsubst_range(). This is a bit hacky since it
makes it harder for callers to process some substrings in between
command substitutions, but that's okay because current callers only
care about what's inside the command substitutions.

Fixes #8394
2021-10-30 18:02:10 +02:00
..
widecharwidth Update widechar_width to Unicode 14 2021-10-26 18:26:25 +02:00
ast_node_types.inc Introduce a new fish ast 2020-07-04 14:58:02 -07:00
ast.cpp Remove some unsued macros and a template 2021-10-01 04:50:19 -07:00
ast.h Put ast_t::populator_t into an anonymous namespace 2021-09-30 11:33:03 -07:00
autoload.cpp Put lots of things in anonymous namespaces 2021-09-30 11:33:03 -07:00
autoload.h Run clang-format on all files 2019-10-13 15:50:48 -07:00
builtin_argparse.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
builtin_argparse.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_bg.cpp Introduce notion of "wait handles" 2021-05-15 20:20:50 -07:00
builtin_bg.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_bind.cpp Move builtin_bind to out-of-line 2021-05-25 17:39:55 -07:00
builtin_bind.h Move builtin_bind to out-of-line 2021-05-25 17:39:55 -07:00
builtin_block.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_block.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_builtin.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_builtin.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_cd.cpp cd: Set var via the string 2021-10-27 10:20:14 +02:00
builtin_cd.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_command.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_command.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_commandline.cpp clang-tidy: replace NULL with nullptr 2021-08-25 16:10:17 -07:00
builtin_commandline.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_complete.cpp Make commandline state thread safe 2021-07-21 11:51:46 -07:00
builtin_complete.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_contains.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_contains.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_disown.cpp Rationalize null handling in disown_job 2021-10-25 16:13:00 -07:00
builtin_disown.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_echo.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_echo.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_emit.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_emit.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_eval.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_eval.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_exit.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_exit.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_fg.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_fg.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_function.cpp Migrate a function's description into its immutable properties 2021-10-23 10:12:52 -07:00
builtin_function.h Reformat 2020-11-22 14:39:48 +01:00
builtin_functions.cpp Continue to refactor functions 2021-10-23 10:12:52 -07:00
builtin_functions.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_history.cpp Adds sub-command clear-session to history command. 2021-10-17 19:27:46 -07:00
builtin_history.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_jobs.cpp Switch to using timef instead of gettimeofday 2021-08-27 16:25:33 -07:00
builtin_jobs.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_math.cpp Always use LC_NUMERIC=C internally (#8204) 2021-10-13 21:09:40 +02:00
builtin_math.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_printf.cpp Force uselocale if glibc is in use 2021-10-28 17:54:35 +02:00
builtin_printf.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_pwd.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_pwd.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_random.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_random.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_read.cpp Put lots of things in anonymous namespaces 2021-09-30 11:33:03 -07:00
builtin_read.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_realpath.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_realpath.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_return.cpp Let "return" exit a script (#8148) 2021-07-21 22:33:39 +02:00
builtin_return.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_set_color.cpp set_color: Print an error for unknown options 2021-05-27 19:03:55 +02:00
builtin_set_color.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_set.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
builtin_set.h Move builtin_bind to out-of-line 2021-05-25 17:39:55 -07:00
builtin_source.cpp Remove some main thread assertions that are not helping 2021-07-15 10:49:27 -07:00
builtin_source.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_status.cpp enum_map stuff to enum_map.h 2021-10-01 03:39:43 -07:00
builtin_status.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_string.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
builtin_string.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_test.cpp Make test error when number is invalid nicer 2021-04-24 11:18:58 +02:00
builtin_test.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_type.cpp Continue to refactor functions 2021-10-23 10:12:52 -07:00
builtin_type.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_ulimit.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin_ulimit.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
builtin_wait.cpp Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
builtin_wait.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
builtin.cpp Add tests for dynamically invoked break and continue 2021-10-25 12:43:30 -07:00
builtin.h argparse: Prevent duplicate error trailer 2021-10-19 17:43:54 +02:00
color.cpp Simplify ASSERT_SORT_ORDER 2021-07-15 13:15:24 -07:00
color.h Refactor color.h/color.cpp 2021-02-08 15:16:21 -06:00
common.cpp Update ConfigureChecks, only do the mtime hack for Linux.. on Linux 2021-10-02 17:02:53 -07:00
common.h Shadow/override iswdigit instead of changing it at individual call sites 2021-10-04 18:44:16 -05:00
complete.cpp Continue to refactor functions 2021-10-23 10:12:52 -07:00
complete.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
enum_map.h enum_map stuff to enum_map.h 2021-10-01 03:39:43 -07:00
enum_set.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
env_dispatch.cpp Cache if tracing is enabled 2021-10-28 19:39:30 +02:00
env_dispatch.h Declare functions in headers or use internal linkage (static) 2020-09-08 22:44:03 +02:00
env_universal_common.cpp Stop some wcs2stringing 2021-10-14 17:02:50 +02:00
env_universal_common.h Stop some wcs2stringing 2021-10-14 17:02:50 +02:00
env.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
env.h Remove now unused out_events parameter 2021-10-26 17:38:40 +02:00
event.cpp Let parser::set_var_and_fire fire the event directly 2021-10-26 17:33:27 +02:00
event.h Let parser::set_var_and_fire fire the event directly 2021-10-26 17:33:27 +02:00
exec.cpp Rename function_get_properties to function_get_props 2021-10-23 10:12:52 -07:00
exec.h exec.h: remove unused declaration 2021-09-24 09:30:25 -07:00
expand.cpp Revert "Use unescape_string_in_place" 2021-10-28 18:09:25 +02:00
expand.h Stop expanding globs in command position when performing error checking 2020-12-22 12:38:51 -08:00
fallback.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
fallback.h remove unused futimes check 2021-09-28 22:02:14 -07:00
fd_monitor.cpp convert const ref to value 2021-08-20 01:16:24 +02:00
fd_monitor.h convert const ref to value 2021-08-20 01:16:24 +02:00
fds.cpp clang-tidy: run through normal checks 2021-08-21 21:59:05 +02:00
fds.h clang-tidy: run through normal checks 2021-08-21 21:59:05 +02:00
fish_indent.cpp Highlight options differently 2021-10-19 17:20:21 +02:00
fish_key_reader.cpp Remove timeout input events 2021-04-17 16:43:28 -07:00
fish_test_helper.cpp Readd awkward unused-result dance 2021-05-18 09:44:29 +02:00
fish_tests.cpp Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
fish_version.cpp Fix build 2021-09-21 18:33:14 -07:00
fish_version.h
fish.cpp Run parse_util_detect_errors on -c commands 2021-07-27 18:37:20 +02:00
flog.cpp Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
flog.h Migrate remaining calls from debug_safe to FLOGF_SAFE 2021-07-05 15:47:56 -07:00
function.cpp Continue to refactor functions 2021-10-23 10:12:52 -07:00
function.h Continue to refactor functions 2021-10-23 10:12:52 -07:00
future_feature_flags.cpp Make '&' only background if followed by a separating character 2021-07-23 22:58:51 +02:00
future_feature_flags.h Make '&' only background if followed by a separating character 2021-07-23 22:58:51 +02:00
global_safety.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
highlight.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
highlight.h Highlight options differently 2021-10-19 17:20:21 +02:00
history_file.cpp Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
history_file.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
history.cpp Adds sub-command clear-session to history command. 2021-10-17 19:27:46 -07:00
history.h Adds sub-command clear-session to history command. 2021-10-17 19:27:46 -07:00
input_common.cpp Complete revert of faulty polling workaround 2021-07-18 18:41:04 +02:00
input_common.h Introduce prepare_to_select, fixing job_summary.py 2021-04-17 16:43:28 -07:00
input.cpp Introduce get_by_sorted_name 2021-08-26 13:40:37 -07:00
input.h Stop using thread local vectors 2021-08-10 13:07:13 -07:00
intern.cpp Declare functions in headers or use internal linkage (static) 2020-09-08 22:44:03 +02:00
intern.h
io.cpp convert const ref to value 2021-08-20 01:16:24 +02:00
io.h convert const ref to value 2021-08-20 01:16:24 +02:00
iothread.cpp also not a thread id: nullptr 2021-10-28 02:14:29 -07:00
iothread.h clang-tidy: run through normal checks 2021-08-21 21:59:05 +02:00
job_group.cpp Implement cancel groups 2020-09-03 11:01:27 -07:00
job_group.h Implement cancel groups 2020-09-03 11:01:27 -07:00
kill.cpp Make the kill ring thread-safe 2021-04-21 17:37:44 -07:00
kill.h Implementation of variable with killring entries 2021-04-21 16:39:29 -07:00
lru.h Remove entry_was_evicted from LRU 2021-09-30 11:33:03 -07:00
maybe.h maybe.h: reference header new 2021-08-17 18:57:16 -05:00
null_terminated_array.cpp Rework null terminated arrays 2021-03-28 15:31:25 -07:00
null_terminated_array.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
operation_context.cpp Allow specifying a limit on number of expansion in operation_context 2020-12-22 12:38:51 -08:00
operation_context.h Expand more when performing history path detection 2021-01-08 12:58:34 -08:00
output.cpp output: Allow "--background foo" and "-b foo" for background colors 2021-06-10 10:42:30 +02:00
output.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
pager.cpp Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
pager.h Revert "Attempt to simplify how completions get presented in the pager" 2020-12-04 16:44:48 +01:00
parse_constants.h remove unused macros 2021-10-01 09:07:08 -07:00
parse_execution.cpp Don't fire variable set event before entering a for-loop 2021-10-28 16:32:58 +02:00
parse_execution.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
parse_tree.cpp Output human-readable descriptions of some parse errors 2021-02-09 22:38:16 +01:00
parse_tree.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
parse_util.cpp Treat text following quoted command substitution as quoted 2021-10-30 18:02:10 +02:00
parse_util.h Continue to refactor functions 2021-10-23 10:12:52 -07:00
parser_keywords.cpp builtin _ is now a reserved keyword 2021-10-11 00:27:44 -07:00
parser_keywords.h
parser.cpp Remove now unused out_events parameter 2021-10-26 17:38:40 +02:00
parser.h Mark parser_t::principal as const 2021-09-24 21:09:28 -07:00
path.cpp Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
path.h builtin cd: print error about broken symlinks 2021-09-17 00:43:12 +02:00
postfork.cpp Replace strerror/sys_errlist after fork with our own errors (#8234) 2021-08-20 17:17:01 +02:00
postfork.h remove accidental change 2021-09-21 18:26:44 -07:00
print_help.cpp Run clang-format on all files 2019-10-13 15:50:48 -07:00
print_help.h
proc.cpp Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
proc.h Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
reader.cpp Remove reader_get_history 2021-10-24 14:17:33 -07:00
reader.h Make commandline state thread safe 2021-07-21 11:51:46 -07:00
redirection.cpp Collapse io_data switch statements 2019-12-29 15:51:22 -08:00
redirection.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
sanity.cpp Change C casts to C++ ones 2020-05-01 13:30:56 -07:00
sanity.h Amend typos and grammar errors 2019-11-25 13:07:15 +01:00
screen.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
screen.h Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
signal.cpp Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
signal.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
termsize.cpp Include <termios.h> instead of <sys/termios.h>. 2021-03-02 12:05:07 +01:00
termsize.h Eliminate the termsize handling from common.h 2020-06-07 20:00:42 -07:00
timer.cpp Pass some parameters by reference/move 2021-03-21 19:41:36 +01:00
timer.h Pass some parameters by reference/move 2021-03-21 19:41:36 +01:00
tinyexpr.cpp tinyexpr: Check for null-pointer 2021-09-15 17:49:58 +02:00
tinyexpr.h math: Use wchar 2020-12-14 22:54:53 +01:00
tokenizer.cpp Make '&' only background if followed by a separating character 2021-07-23 22:58:51 +02:00
tokenizer.h Tighten up includes, some typedefs -> using 2021-09-21 18:05:53 -07:00
topic_monitor.cpp Introduce select_wrapper_t 2021-04-17 16:43:27 -07:00
topic_monitor.h Introduce noncopyable_t and nonmovable_t 2021-07-23 11:19:42 -07:00
trace.cpp Cache if tracing is enabled 2021-10-28 19:39:30 +02:00
trace.h Cache if tracing is enabled 2021-10-28 19:39:30 +02:00
utf8.cpp Change C casts to C++ ones 2020-05-01 13:30:56 -07:00
utf8.h [clang-tidy] Fix inconsistent declarations 2019-11-25 14:13:33 -08:00
util.cpp wcsfilecmp: Stop actually computing the numbers 2021-10-07 17:57:52 +02:00
util.h Return glob ordering to pre-3.1 state 2020-02-14 19:06:19 +01:00
wait_handle.cpp Refactor wait handles 2021-05-17 15:25:21 -07:00
wait_handle.h Mild refactoring of wait handles 2021-10-28 10:37:43 -07:00
wcstringutil.cpp Wrap even more stuff in anonymous namespaces 2021-09-30 11:33:03 -07:00
wcstringutil.h Handle backspaces for visible width 2021-09-23 12:58:35 +02:00
wgetopt.cpp Make arguments to builtins const 2021-03-28 15:31:25 -07:00
wgetopt.h Make arguments to builtins const 2021-03-28 15:31:25 -07:00
wildcard.cpp Revert "Swap file size and file type description position in pager" 2021-10-23 22:17:09 -07:00
wildcard.h Clean up some comments around wildcard expansion 2020-12-28 23:51:18 -08:00
wutil.cpp Cleanup on aisle haphazard-everywhere 2021-10-28 01:47:49 -07:00
wutil.h Always use LC_NUMERIC=C internally (#8204) 2021-10-13 21:09:40 +02:00