fish-shell/tests/checks
Johannes Altmanninger 29dc307111 Insert some completions with quotes instead of backslashes
File names that have lots of spaces look quite ugly when inserted as
completions because every space will have a backslash.

Add an initial heuristic to decide when to use quotes instead of
backslash escapes.

Quote when
1. it's not an autosuggestion
2. we replace the token or insert a fresh one
3. we will add a space at the end

In future we could relax some of these requirements.

Requirement 2 means we don't quote when appending to an existing token.
Need to find a natural behavior here.

Re 3, if the completion adds no space, users will probably want to add more
characters, which looks a bit weird if the token has a trailing quote.
We could relax this requirement for directory completions, so «ls so»
completes to «ls 'some dir with spaces'/».

Closes #5433
2024-04-13 15:34:21 +02:00
..
broken-config/fish Port config tests to littlecheck 2019-06-25 22:31:06 +02:00
abbr.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
alias.fish Support quoted escaping also when ' or \ is present 2024-04-13 15:33:05 +02:00
andandoror.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
andor.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
argparse.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
bad-option.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
basic.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
bind.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
braces.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
broken-config.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
builtinbuiltin.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
caller-exit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
caller-observer.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
cd.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
check-all-fish-files.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
check-completions.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
check-translations.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
cmdsub-limit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
cmdsub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
colon-delimited-var.fish Clean up how PATH and CDPATH munging occurs 2019-11-02 16:48:08 -07:00
command-1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
command-2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
command-not-found.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
command-vars-persist.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
commandline.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
complete_directories.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
complete-group-order.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
complete.fish Insert some completions with quotes instead of backslashes 2024-04-13 15:34:21 +02:00
contains_opt.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
count.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
deep-cmdsub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
default-setup-path.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
directory-redirect.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
disown-parent.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
empty.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
env.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
eval.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
exec.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
exit-status-with-closing-stderr.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
expansion.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
fds.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-ampersand-nobg-in-token1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret3.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-nocaret4.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-percent-self1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-percent-self2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-qmark1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-qmark2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-string-backslashes-off.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
features-string-backslashes.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
fish_add_path.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
fish_exit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
fish_user_paths.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
for.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
function-definition.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
function.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
functions.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
git.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
glob.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
history.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
indent.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command-2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command-mix-ordering.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command-mix.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-command.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
init-unreadable-cwd.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
invocation.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
job-control-noninteractive.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
job-control-not-a-tty.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
job-ids.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
jobs-are-escaped.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
jobs.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
line-continuation.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
line-number.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
locale-numeric.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
locale.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
loops.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
math.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
no-config.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
no-execute.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
noshebang.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
not.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
nuls.fish Support quoted escaping also when ' or \ is present 2024-04-13 15:33:05 +02:00
path.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
pipeline-pgroup.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
pipestatus.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
print-help.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
printf.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
prompt.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
psub.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
random.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
rc-returned.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
read.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
realpath.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
redirect.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
regex-import.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
return.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
scoping.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
self-signal-usr1.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
set.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
setenv.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
sigint.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
sigint2.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
signal.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
slices.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
stack-overflow.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
status-command.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
status-value.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
status.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
string-advanced.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
string.fish Support quoted escaping also when ' or \ is present 2024-04-13 15:33:05 +02:00
switch.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
symlinks-not-overwritten.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
syntax-error-location.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
test.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
threads.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
time.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-abbr.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-bind.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-bind2.fish Update commandline state snapshot lazily 2024-04-13 14:36:11 +02:00
tmux-commandline.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-complete.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-history-search.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
tmux-prompt.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
trace.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
trap_print.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
trap.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
type.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
ulimit.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
umask.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
variable-assignment.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
vars_as_commands.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
version.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
wait.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
wildcard.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
wraps.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00
zero_based_array.fish tests: filter control sequences only when interactive 2024-04-12 12:28:22 +02:00