Extended & human-friendly keys

See the changelog additions for user-visible changes.

Since we enable/disable terminal protocols whenever we pass terminal ownership,
tests can no longer run in parallel on the same terminal.

For the same reason, readline shortcuts in the gdb REPL will not work anymore.
As a remedy, use gdbserver, or lobby for CSI u support in libreadline.

Add sleep to some tests, otherwise they fall (both in CI and locally).

There are two weird failures on FreeBSD remaining, disable them for now
https://github.com/fish-shell/fish-shell/pull/10359/checks?check_run_id=23330096362

Design and implementation borrows heavily from Kakoune.

In future, we should try to implement more of the kitty progressive
enhancements.

Closes #10359
This commit is contained in:
Johannes Altmanninger
2024-03-30 16:10:12 +01:00
parent 8ada027f05
commit 8bf8b10f68
180 changed files with 2203 additions and 1304 deletions

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Universal abbreviations are imported.
set -U _fish_abbr_cuckoo somevalue

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Avoid regressions of issue \#3860 wherein the first word of the alias ends with a semicolon
function foo
echo ran foo

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# "Basic && and || support"
echo first && echo second

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
set -xl LANG C # uniform quotes

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
##########
# NOTE: This uses argparse, which touches the local variables.

View File

@@ -1,2 +1,2 @@
#RUN: %fish -Z
#RUN: %fish -Z | %filter-ctrlseqs
# CHECKERR: {{.*fish}}: {{unrecognized option: Z|invalid option -- '?Z'?|unknown option -- Z|illegal option -- Z|-Z: unknown option}}

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
#
# Test function, loops, conditionals and some basic elements
#

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Test various `bind` command invocations. This is meant to verify that
# invalid flags, mode names, etc. are caught as well as to verify that valid
# ones are allowed.
@@ -14,102 +14,103 @@ bind -M bind-mode \cX true
# This should succeed and result in a success, zero, status.
bind -M bind_mode \cX true
### HACK: All full bind listings need to have the \x7f -> backward-delete-char
# binding explicitly removed, because on some systems that's backspace, on others not.
# Listing bindings
bind | string match -v '*backward-delete-char'
bind --user --preset | string match -v '*backward-delete-char'
bind | string match -v '*escape,\\[*' # Hide legacy bindings.
bind --user --preset | string match -v '*escape,\\[*'
# CHECK: bind --preset '' self-insert
# CHECK: bind --preset \n execute
# CHECK: bind --preset \r execute
# CHECK: bind --preset \t complete
# CHECK: bind --preset \cc cancel-commandline
# CHECK: bind --preset \cd exit
# CHECK: bind --preset \ce bind
# CHECK: bind --preset \cs pager-toggle-search
# CHECK: bind --preset \cu backward-kill-line
# CHECK: bind --preset \e\[A up-line
# CHECK: bind --preset \e\[B down-line
# CHECK: bind --preset \e\[C forward-char
# CHECK: bind --preset \e\[D backward-char
# CHECK: bind --preset \cp up-line
# CHECK: bind --preset \cn down-line
# CHECK: bind --preset \cb backward-char
# CHECK: bind --preset \cf forward-char
# CHECK: bind -M bind_mode \cx true
# CHECK: bind --preset enter execute
# CHECK: bind --preset tab complete
# CHECK: bind --preset ctrl-c cancel-commandline
# CHECK: bind --preset ctrl-d exit
# CHECK: bind --preset ctrl-e bind
# CHECK: bind --preset ctrl-s pager-toggle-search
# CHECK: bind --preset ctrl-u backward-kill-line
# CHECK: bind --preset backspace backward-delete-char
# CHECK: bind --preset up up-line
# CHECK: bind --preset down down-line
# CHECK: bind --preset right forward-char
# CHECK: bind --preset left backward-char
# CHECK: bind --preset ctrl-p up-line
# CHECK: bind --preset ctrl-n down-line
# CHECK: bind --preset ctrl-b backward-char
# CHECK: bind --preset ctrl-f forward-char
# CHECK: bind -M bind_mode ctrl-x true
# CHECK: bind --preset '' self-insert
# CHECK: bind --preset \n execute
# CHECK: bind --preset \r execute
# CHECK: bind --preset \t complete
# CHECK: bind --preset \cc cancel-commandline
# CHECK: bind --preset \cd exit
# CHECK: bind --preset \ce bind
# CHECK: bind --preset \cs pager-toggle-search
# CHECK: bind --preset \cu backward-kill-line
# CHECK: bind --preset \e\[A up-line
# CHECK: bind --preset \e\[B down-line
# CHECK: bind --preset \e\[C forward-char
# CHECK: bind --preset \e\[D backward-char
# CHECK: bind --preset \cp up-line
# CHECK: bind --preset \cn down-line
# CHECK: bind --preset \cb backward-char
# CHECK: bind --preset \cf forward-char
# CHECK: bind -M bind_mode \cx true
# CHECK: bind --preset enter execute
# CHECK: bind --preset tab complete
# CHECK: bind --preset ctrl-c cancel-commandline
# CHECK: bind --preset ctrl-d exit
# CHECK: bind --preset ctrl-e bind
# CHECK: bind --preset ctrl-s pager-toggle-search
# CHECK: bind --preset ctrl-u backward-kill-line
# CHECK: bind --preset backspace backward-delete-char
# CHECK: bind --preset up up-line
# CHECK: bind --preset down down-line
# CHECK: bind --preset right forward-char
# CHECK: bind --preset left backward-char
# CHECK: bind --preset ctrl-p up-line
# CHECK: bind --preset ctrl-n down-line
# CHECK: bind --preset ctrl-b backward-char
# CHECK: bind --preset ctrl-f forward-char
# CHECK: bind -M bind_mode ctrl-x true
# Preset only
bind --preset | string match -v '*backward-delete-char'
bind --preset | string match -v '*escape,\\[*'
# CHECK: bind --preset '' self-insert
# CHECK: bind --preset \n execute
# CHECK: bind --preset \r execute
# CHECK: bind --preset \t complete
# CHECK: bind --preset \cc cancel-commandline
# CHECK: bind --preset \cd exit
# CHECK: bind --preset \ce bind
# CHECK: bind --preset \cs pager-toggle-search
# CHECK: bind --preset \cu backward-kill-line
# CHECK: bind --preset \e\[A up-line
# CHECK: bind --preset \e\[B down-line
# CHECK: bind --preset \e\[C forward-char
# CHECK: bind --preset \e\[D backward-char
# CHECK: bind --preset \cp up-line
# CHECK: bind --preset \cn down-line
# CHECK: bind --preset \cb backward-char
# CHECK: bind --preset \cf forward-char
# CHECK: bind --preset enter execute
# CHECK: bind --preset tab complete
# CHECK: bind --preset ctrl-c cancel-commandline
# CHECK: bind --preset ctrl-d exit
# CHECK: bind --preset ctrl-e bind
# CHECK: bind --preset ctrl-s pager-toggle-search
# CHECK: bind --preset ctrl-u backward-kill-line
# CHECK: bind --preset backspace backward-delete-char
# CHECK: bind --preset up up-line
# CHECK: bind --preset down down-line
# CHECK: bind --preset right forward-char
# CHECK: bind --preset left backward-char
# CHECK: bind --preset ctrl-p up-line
# CHECK: bind --preset ctrl-n down-line
# CHECK: bind --preset ctrl-b backward-char
# CHECK: bind --preset ctrl-f forward-char
# User only
bind --user | string match -v '*backward-delete-char'
# CHECK: bind -M bind_mode \cx true
bind --user | string match -v '*escape,\\[*'
# CHECK: bind -M bind_mode ctrl-x true
# Adding bindings
bind \t 'echo banana'
bind | string match -v '*backward-delete-char'
bind tab 'echo banana'
bind | string match -v '*escape,\\[*'
# CHECK: bind --preset '' self-insert
# CHECK: bind --preset \n execute
# CHECK: bind --preset \r execute
# CHECK: bind --preset \t complete
# CHECK: bind --preset \cc cancel-commandline
# CHECK: bind --preset \cd exit
# CHECK: bind --preset \ce bind
# CHECK: bind --preset \cs pager-toggle-search
# CHECK: bind --preset \cu backward-kill-line
# CHECK: bind --preset \e\[A up-line
# CHECK: bind --preset \e\[B down-line
# CHECK: bind --preset \e\[C forward-char
# CHECK: bind --preset \e\[D backward-char
# CHECK: bind --preset \cp up-line
# CHECK: bind --preset \cn down-line
# CHECK: bind --preset \cb backward-char
# CHECK: bind --preset \cf forward-char
# CHECK: bind -M bind_mode \cx true
# CHECK: bind \t 'echo banana'
# CHECK: bind --preset enter execute
# CHECK: bind --preset tab complete
# CHECK: bind --preset ctrl-c cancel-commandline
# CHECK: bind --preset ctrl-d exit
# CHECK: bind --preset ctrl-e bind
# CHECK: bind --preset ctrl-s pager-toggle-search
# CHECK: bind --preset ctrl-u backward-kill-line
# CHECK: bind --preset backspace backward-delete-char
# CHECK: bind --preset up up-line
# CHECK: bind --preset down down-line
# CHECK: bind --preset right forward-char
# CHECK: bind --preset left backward-char
# CHECK: bind --preset ctrl-p up-line
# CHECK: bind --preset ctrl-n down-line
# CHECK: bind --preset ctrl-b backward-char
# CHECK: bind --preset ctrl-f forward-char
# CHECK: bind -M bind_mode ctrl-x true
# CHECK: bind tab 'echo banana'
# Erasing bindings
bind --erase \t
bind \t
bind \t 'echo wurst'
# CHECK: bind --preset \t complete
bind --erase --user --preset \t
bind \t
# CHECKERR: bind: No binding found for sequence '\t'
bind --erase tab
bind tab
bind tab 'echo wurst'
# CHECK: bind --preset tab complete
bind --erase --user --preset tab
bind tab
# CHECKERR: bind: No binding found for key 'tab'
bind ctrl-\b
# CHECKERR: bind: Cannot add control modifier to control character 'ctrl-h'
exit 0

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
echo x-{1}
#CHECK: x-{1}
@@ -22,7 +22,7 @@ echo foo-{""} # still expands to foo-{}
#CHECK: foo-{}
echo foo-{$undefinedvar} # still expands to nothing
#CHECK:
#CHECK:
echo foo-{,,,} # four empty items in the braces.
#CHECK: foo- foo- foo- foo-

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
begin
set -l dir $PWD/(dirname (status -f))
set -gx XDG_CONFIG_HOME $dir/broken-config/

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Tests for the "builtin" builtin/keyword.
builtin -q string; and echo String exists
#CHECK: String exists

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
echo (function foo1 --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo)
# CHECK: caller-exit foo1
echo (function foo2 --on-job-exit caller; end; functions --handlers-type process-exit | grep foo)

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Verify the '--on-job-exit caller' misfeature.
function make_call_observer -a type

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
set -g fish (realpath $fish)

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
# Test ALL THE FISH FILES
# in share/, that is - the tests are exempt because they contain syntax errors, on purpose

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
# Test all completions where the command exists
# No output is good output

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
#REQUIRES: msgfmt --help
set -l fail_count 0

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# This tests various corner cases involving command substitution.

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
echo $(echo 1\n2)
# CHECK: 1 2

View File

@@ -1,2 +1,2 @@
#RUN: %fish -c "echo 1.2.3.4."
#RUN: %fish -c "echo 1.2.3.4." | %filter-ctrlseqs
# CHECK: 1.2.3.4.

View File

@@ -1,3 +1,3 @@
#RUN: %fish -c "echo 1.2.3.4." -c "echo 5.6.7.8."
#RUN: %fish -c "echo 1.2.3.4." -c "echo 5.6.7.8." | %filter-ctrlseqs
# CHECK: 1.2.3.4.
# CHECK: 5.6.7.8.

View File

@@ -1,18 +1,18 @@
# RUN: %fish -C 'set -g fish %fish' %s
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
set -g PATH
$fish -c "nonexistent-command-1234 banana rama"
#CHECKERR: fish: Unknown command: nonexistent-command-1234
#CHECKERR: fish:
#CHECKERR: fish:
#CHECKERR: nonexistent-command-1234 banana rama
#CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~^
$fish -C 'function fish_command_not_found; echo cmd-not-found; end' -ic "nonexistent-command-1234 1 2 3 4"
#CHECKERR: cmd-not-found
#CHECKERR: fish:
#CHECKERR: fish:
#CHECKERR: nonexistent-command-1234 1 2 3 4
#CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~^
$fish -C 'function fish_command_not_found; echo command-not-found $argv; end' -c "nonexistent-command-abcd foo bar baz"
#CHECKERR: command-not-found nonexistent-command-abcd foo bar baz
#CHECKERR: fish:
#CHECKERR: fish:
#CHECKERR: nonexistent-command-abcd foo bar baz
#CHECKERR: ^~~~~~~~~~~~~~~~~~~~~~~^

View File

@@ -1,2 +1,2 @@
#RUN: %fish -c 'set foo bar' -c 'echo $foo'
#RUN: %fish -c 'set foo bar' -c 'echo $foo' | %filter-ctrlseqs
# CHECK: bar

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
commandline --input "echo foo | bar" --is-valid
and echo Valid

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
function fooc; true; end;

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
function complete_test_alpha1
echo $argv
end

View File

@@ -1,4 +1,4 @@
#RUN: %fish --interactive %s
#RUN: %fish --interactive %s | %filter-ctrlseqs
# ^ interactive so we can do `complete`
mkdir -p __fish_complete_directories/
cd __fish_complete_directories

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
function commandline
if test $argv[1] = -ct
echo --long4\n-4

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Validate the behavior of the `count` command.
# no args

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Ensure we don't hang on deep command substitutions - see #6503.

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
if command -q getconf
# (no env -u, some systems don't support that)

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
begin
end >.
status -b; and echo "status -b returned true after bad redirect on a begin block"

View File

@@ -1,4 +1,4 @@
# RUN: env fish_test_helper=%fish_test_helper %fish %s
# RUN: env fish_test_helper=%fish_test_helper %fish %s | %filter-ctrlseqs
# Ensure that a job which attempts to disown itself does not explode.
# Here fish_test_helper is the process group leader; we attempt to disown

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# See issue 5692

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
function getenvs
env | string match FISH_ENV_TEST_\*

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Regression test for issue #4443
eval set -l previously_undefined foo
echo $previously_undefined

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
exec cat <nosuchfile
#CHECKERR: warning: An error occurred while redirecting file 'nosuchfile'

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
argparse r-require= -- --require 2>/dev/null
echo $status
# CHECK: 2

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish %fish' %s
# RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
# caret position (#5812)
printf '<%s>\n' ($fish -c ' $f[a]' 2>&1)

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C "set helper %fish_test_helper" %s
# RUN: %fish -C "set helper %fish_test_helper" %s | %filter-ctrlseqs
# Check that we don't leave stray FDs.

View File

@@ -1,4 +1,4 @@
#RUN: %fish --features=ampersand-nobg-in-token -C 'set -g fish_indent %fish_indent' %s
#RUN: %fish --features=ampersand-nobg-in-token -C 'set -g fish_indent %fish_indent' %s | %filter-ctrlseqs
echo no&background
# CHECK: no&background

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'no-stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
#RUN: %fish --features 'no-stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status' | %filter-ctrlseqs
# CHECK: nocaret: 0

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status'
#RUN: %fish --features 'stderr-nocaret' -c 'status test-feature stderr-nocaret; echo nocaret: $status' | %filter-ctrlseqs
# CHECK: nocaret: 0

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'no-stderr-nocaret' -c 'echo -n careton:; echo ^/dev/null'
#RUN: %fish --features 'no-stderr-nocaret' -c 'echo -n careton:; echo ^/dev/null' | %filter-ctrlseqs
# CHECK: careton:^/dev/null

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features ' stderr-nocaret' -c 'echo -n "caretoff: "; echo ^/dev/null'
#RUN: %fish --features ' stderr-nocaret' -c 'echo -n "caretoff: "; echo ^/dev/null' | %filter-ctrlseqs
# CHECK: caretoff: ^/dev/null

View File

@@ -1,4 +1,4 @@
#RUN: %fish --features=remove-percent-self %s
#RUN: %fish --features=remove-percent-self %s | %filter-ctrlseqs
echo %self
# CHECK: %self

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'remove-percent-self' -c 'status test-feature remove-percent-self; echo remove-percent-self: $status'
#RUN: %fish --features 'remove-percent-self' -c 'status test-feature remove-percent-self; echo remove-percent-self: $status' | %filter-ctrlseqs
# CHECK: remove-percent-self: 0

View File

@@ -1,3 +1,3 @@
# Explicitly overriding HOME/XDG_CONFIG_HOME is only required if not invoking via `make test`
# RUN: %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"'
# RUN: %fish --features '' -c 'string match --quiet "??" ab ; echo "qmarkon: $status"' | %filter-ctrlseqs
#CHECK: qmarkon: 1

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'qmark-noglob' -C 'string match --quiet "??" ab ; echo "qmarkoff: $status"'
#RUN: %fish --features 'qmark-noglob' -C 'string match --quiet "??" ab ; echo "qmarkoff: $status"' | %filter-ctrlseqs
# CHECK: qmarkoff: 1

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'no-regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
#RUN: %fish --features 'no-regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' | %filter-ctrlseqs
# CHECK: a\b\c

View File

@@ -1,2 +1,2 @@
#RUN: %fish --features 'regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"'
#RUN: %fish --features 'regex-easyesc' -C 'string replace -ra "\\\\" "\\\\\\\\" -- "a\b\c"' | %filter-ctrlseqs
# CHECK: a\\b\\c

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
#
# This deals with $PATH manipulation. We need to be careful not to step on anything.

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
# fish_exit fires successfully.
echo 'function do_exit --on-event fish_exit; echo "fish_exiting $fish_pid"; end' > /tmp/test_exit.fish

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
#
# This deals with $PATH manipulation. We need to be careful not to step on anything.

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# A for-loop-variable is a local variable in the enclosing scope.
set -g i global

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
function stuff --argument a b c
# This is a comment

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
function t --argument-names a b c
echo t
end

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Test the `functions` builtin
function f1

View File

@@ -1,4 +1,4 @@
#RUN: %fish -i %s
#RUN: %fish -i %s | %filter-ctrlseqs
# Note: ^ this is interactive so we test interactive behavior,
# e.g. the fish_git_prompt variable handlers test `status is-interactive`.
#REQUIRES: command -v git
@@ -198,4 +198,3 @@ end
$fish -c 'complete -C "git -C ./.gi"'
# CHECK: ./.git/ Directory

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
set -l oldpwd $PWD
cd (mktemp -d)

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Verify that specifying unexpected options or arguments results in an error.
# First using the legacy, now deprecated, long options to specify a

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C 'set -g fish_indent %fish_indent' %s
# RUN: %fish -C 'set -g fish_indent %fish_indent' %s | %filter-ctrlseqs
# Test file for fish_indent
# Note that littlecheck ignores leading whitespace, so we have to use {{ }} to explicitly match it.
@@ -73,7 +73,7 @@ end | cat | cat | begin ; echo hi ; end | begin ; begin ; echo hi ; end ; end ar
#CHECK: begin
#CHECK: {{ }}echo hi
#CHECK:
#CHECK:
#CHECK: end | cat | cat | begin
#CHECK: {{ }}echo hi
#CHECK: end | begin
@@ -99,7 +99,7 @@ end
#CHECK: {{ }}{{ }}echo sup
#CHECK: {{ }}case beta gamma
#CHECK: {{ }}{{ }}echo hi
#CHECK:
#CHECK:
#CHECK: end
echo -n '
@@ -117,15 +117,15 @@ function hello_world
' | $fish_indent
#CHECK: function hello_world
#CHECK:
#CHECK:
#CHECK: {{ }}begin
#CHECK: {{ }}{{ }}echo hi
#CHECK: {{ }}end | cat
#CHECK:
#CHECK:
#CHECK: {{ }}echo sup
#CHECK: {{ }}echo sup
#CHECK: {{ }}echo hello
#CHECK:
#CHECK:
#CHECK: {{ }}echo hello
#CHECK: end
@@ -149,13 +149,13 @@ qqq
end' | $fish_indent
#CHECK: echo alpha #comment1
#CHECK: #comment2
#CHECK:
#CHECK:
#CHECK: #comment3
#CHECK: for i in abc #comment1
#CHECK: {{ }}#comment2
#CHECK: {{ }}echo hi
#CHECK: end
#CHECK:
#CHECK:
#CHECK: switch foo #abc
#CHECK: {{ }}# bar
#CHECK: {{ }}case bar
@@ -299,26 +299,26 @@ echo bye
#CHECK: {{ }}echo yes
#CHECK: en\
#CHECK: d
#CHECK:
#CHECK:
#CHECK: while true
#CHECK: {{ }}builtin yes
#CHECK: end
#CHECK:
#CHECK:
#CHECK: alpha | beta
#CHECK:
#CHECK:
#CHECK: gamma | \
#CHECK: # comment3
#CHECK: delta
#CHECK:
#CHECK:
#CHECK: if true
#CHECK: {{ }}echo abc
#CHECK: end
#CHECK:
#CHECK:
#CHECK: if false # comment4
#CHECK: {{ }}and true && false
#CHECK: {{ }}echo abc
#CHECK: end
#CHECK:
#CHECK:
#CHECK: echo hi |
#CHECK: {{ }}echo bye

View File

@@ -1,3 +1,3 @@
#RUN: %fish -C 'echo init-command' -C 'echo 2nd init-command'
#RUN: %fish -C 'echo init-command' -C 'echo 2nd init-command' | %filter-ctrlseqs
# CHECK: init-command
# CHECK: 2nd init-command

View File

@@ -1,3 +1,3 @@
#RUN: %fish -c 'echo command' -C 'echo init-command'
#RUN: %fish -c 'echo command' -C 'echo init-command' | %filter-ctrlseqs
# CHECK: init-command
# CHECK: command

View File

@@ -1,3 +1,3 @@
#RUN: %fish -C 'echo init-command' -c 'echo command'
#RUN: %fish -C 'echo init-command' -c 'echo command' | %filter-ctrlseqs
# CHECK: init-command
# CHECK: command

View File

@@ -1,2 +1,2 @@
#RUN: %fish -C 'echo init-command'
#RUN: %fish -C 'echo init-command' | %filter-ctrlseqs
# CHECK: init-command

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
# Test that fish doesn't crash if cwd is unreadable at the start (#6597)
set -l oldpwd $PWD

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
$fish -c "echo 1.2.3.4."
# CHECK: 1.2.3.4.
@@ -107,4 +107,3 @@ $fish --no-config -c 'echo notprinted | and true'
# Regression test for a hang.
echo "set -L" | $fish > /dev/null

View File

@@ -1,4 +1,4 @@
#RUN: env fth=%fish_test_helper fish=%fish %fish %s
#RUN: env fth=%fish_test_helper fish=%fish %fish %s | %filter-ctrlseqs
# Ensure job control works in non-interactive environments.

View File

@@ -1,4 +1,4 @@
#RUN: echo 'status job-control full; command echo A ; echo B;' | %fish
#RUN: echo 'status job-control full; command echo A ; echo B;' | %fish | %filter-ctrlseqs
# Regression test for #6573.

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Ensure that job IDs are sequential.

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Ensure that jobs are printed with new lines escaped

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Verify zombies are not left by disown (#7183, #5342)
# Do this first to avoid colliding with the other disowned processes below, which may

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
ech\
o echo
#CHECK: echo

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
#
# These lines left around because we need the line numbers.
# This file in general requires careful editing in the middle, I recommend appending.

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# musl currently does not have a `locale` command, so we skip this test there.
# REQUIRES: command -v locale
# We need a comma-using locale we know.

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C "set fish %fish" %s
#RUN: %fish -C "set fish %fish" %s | %filter-ctrlseqs
# This hangs when running on github actions with tsan for unknown reasons,
# see #7934.
#REQUIRES: test -z "$GITHUB_WORKFLOW"

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -g fish %fish' %s
#RUN: %fish -C 'set -g fish %fish' %s | %filter-ctrlseqs
function never_runs
while false

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# OpenBSD doesn't do hex numbers in str/wcstod (like C99 requires).
# So let's skip this.
#REQUIRES: test "$(uname)" != OpenBSD

View File

@@ -1,4 +1,4 @@
#RUN: %fish --no-config %s
#RUN: %fish --no-config %s | %filter-ctrlseqs
functions | string match help
# CHECK: help

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
# Test that fish -n doesn't check for command existence - function autoloading throws a wrench in that.
echo "type foo" | $fish -n

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Do not run under sanitizers in CI, as they intercept a busted posix_spawn
# which mishandles shebangless scripts.

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
not true
echo $status

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# NUL-handling
# This one actually prints a NUL

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# The "path" builtin for dealing with paths
# Extension - for figuring out the file extension of a given path.

View File

@@ -1,4 +1,4 @@
# RUN: env fth=%fish_test_helper fish=%fish %fish %s
# RUN: env fth=%fish_test_helper fish=%fish %fish %s | %filter-ctrlseqs
status job-control full

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# pipestatus variable - builtins only
false | false | false

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# Test redirecting builtin help with a pipe
set -lx __fish_data_dir (mktemp -d)

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
printf "%d %d\n" 1 2 3
# CHECK: 1 2

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
prompt_pwd -d 1 /foo/bar/baz
# CHECK: /f/b/baz

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
set -l filename (echo foo | psub --testing)
test -f $filename
or echo 'psub is not a regular file' >&2

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
set -l max 9223372036854775807
set -l close_max 9223372036854775806
set -l min -9223372036854775807

View File

@@ -1,2 +1,2 @@
#RUN: %fish -c '%fish -c false; echo RC: $status'
#RUN: %fish -c '%fish -c false; echo RC: $status' | %filter-ctrlseqs
# CHECK: RC: 1

View File

@@ -1,4 +1,4 @@
# RUN: %fish -C "set fish %fish" %s
# RUN: %fish -C "set fish %fish" %s | %filter-ctrlseqs
# Set term again explicitly to ensure behavior.
set -gx TERM xterm
# Read with no vars is not an error
@@ -155,7 +155,7 @@ echo $foo
echo newline | read -lz foo
echo $foo
#CHECK: newline
#CHECK:
#CHECK:
echo -n 'test ing' | read -lz foo bar
print_vars foo bar
#CHECK: 1 'test' 1 'ing'
@@ -303,7 +303,7 @@ echo $foo
echo $bar
#CHECK: b
echo $baz
#CHECK:
#CHECK:
# Multi-char delimiters with -d
echo a...b...c | read -l -d "..." a b c

View File

@@ -1,4 +1,4 @@
# RUN: %fish %s
# RUN: %fish %s | %filter-ctrlseqs
# $XDG_DATA_HOME can itself be a relative path. So force it to an absolute
# path so we can remove it from any resolved paths below. This is needed
# because the contents of the builtin realpath.out file can't include any $PWD

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
function outnerr
command echo out $argv

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Tests for importing named regex groups as fish variables
# Invalid variable name?

View File

@@ -1,4 +1,4 @@
#RUN: %fish -C 'set -l fish %fish' %s
#RUN: %fish -C 'set -l fish %fish' %s | %filter-ctrlseqs
# Some tests of the "return" builtin.
$fish -c 'return 5'

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# Test scoping rules for functions and status
set -e smurf

View File

@@ -1,4 +1,4 @@
#RUN: %fish %s
#RUN: %fish %s | %filter-ctrlseqs
# See #6397

Some files were not shown because too many files have changed in this diff Show More