Commit Graph

1118 Commits

Author SHA1 Message Date
Fabian Homborg
3c2cf6241b Add some error tests for cd
Makes work on #7577 easier.
2020-12-28 23:23:06 +01:00
Johannes Altmanninger
322ceb7ab4 builtin realpath: use absolute path also with -s/--no-symlinks
The old test needs to be changed because $XDG_DATA_HOME can be relative.

Fixes #7574
2020-12-24 08:53:08 +01:00
ridiculousfish
e43913a547 Stop expanding globs in command position when performing error checking
Before running a command, or before importing a command from bash history,
we perform error checking. As part of error checking we expand commands
including variables and globs. If the glob is very large, like `/**`, then
we could hang expanding it.

One fix would be to limit the amount of expansion from the glob, but
instead let's just not expand command globs when performing error checking.

Fixes #7407
2020-12-22 12:38:51 -08:00
ridiculousfish
36766ea3d7 Correct $status for certain pipeline-aborting failures
If we refused to launch a job because of a "pipeline aborting" error,
then it's the caller's responsibility to set $status.

Fixes #7540
2020-12-13 17:33:34 -08:00
Fabian Homborg
a57f7a8653 tests/pexpects/bind: Increase a timeout
Last attempt, if this keeps failing on CI (specifically macOS seems to
be affected), I'm removing the test as it's more noise than use.
2020-12-13 14:57:37 +01:00
Fabian Homborg
b7f47344b0 Print nicer "defined in" for functions defined on stdin/via source
This would tell you a function was "Defined in - @ line 1" for every
function defined via `source`.

Really, ideally we'd figure out where the *source* call was, but that'
much more complicated, so we just give a comprehensible message.
2020-12-11 23:09:16 +01:00
Fabian Homborg
425dabd6b1 Change fish_trace prefix to "->" instead of plusses
This matches what we do in --profile's output:

```
> source /home/alfa/.config/fish/config.fish
--> set -gx XDG_CACHE_HOME /home/alfa/.cache
--> set -gx XDG_CONFIG_HOME /home/alfa/.config
--> set -gx XDG_DATA_HOME /home/alfa/.local/share
```

instead of

```
+ source /home/alfa/.config/fish/config.fish
+++ set -gx XDG_CACHE_HOME /home/alfa/.cache
+++ set -gx XDG_CONFIG_HOME /home/alfa/.config
+++ set -gx XDG_DATA_HOME /home/alfa/.local/share
```
2020-12-11 21:24:33 +01:00
Fabian Homborg
78173cf541 tests/bind: Rationalize delays
This increases a 100ms timeout to 200ms, because we've hit it on
Github Actions:

```
 INPUT    3904.65 ms (Line 223): set -g fish_escape_delay_ms 100\n
OUTPUT      +1.74 ms (Line 224): \rprompt 25>
 INPUT      +0.71 ms (Line 230): echo abc def
 INPUT      +0.57 ms (Line 231): \x1b
 INPUT      +0.57 ms (Line 232): t\r
OUTPUT      +2.41 ms (Line 234): \r\ndef abc\r\n
OUTPUT      +1.63 ms (Line 234): \rprompt 26>
 INPUT      +0.75 ms (Line 239): echo ghi jkl
 INPUT      +0.57 ms (Line 240): \x1b
 INPUT    +134.98 ms (Line 242): t\r
```

In other places it decreases sleeps where we just wait for a timeout to elapse, in which case we don't need much longer than the timeout.
2020-12-10 16:25:57 +01:00
Fabian Homborg
ab5d7f80d0 Restyle codebase
And again clang-format does something I don't like:

-    if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0) return found;
+    if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0)
+        return found;

I *know* this is a bit of a long line. I would still quite like having
no brace-less multi-line if *ever*. Either put the body on the same
line, or add braces.

Blergh
2020-12-06 15:39:54 +01:00
Fabian Homborg
aa895645dd Add string to reserved keywords
Since `string match` now creates variables, wrapping `string`
necessarily breaks things, so we need to disallow it.

See #7459, #7509.
2020-12-06 15:39:49 +01:00
Fabian Homborg
8172ad4463 Add test for double-redirection crash
Fixes #7447
2020-12-06 14:02:08 +01:00
Fabian Homborg
02efce51a9 string match: Only import variables for the first matching argument
This makes it work the same whether it quits early (with "-q") or not,
and it's generally nice to nail this down.

See #7495.
2020-12-04 18:45:08 +01:00
Fabian Homborg
720982a3cb string: Quit early if --quiet is satisfied
E.g. if we do `string match -q`, and we find a match, nothing about
the input can change anything, so we quit early.

This is mainly useful for performance, but it also allows `string`
with `-q` to be used with infinite input (e.g. `yes`).

Alternative to #7495.
2020-12-01 18:55:01 +01:00
Johannes Altmanninger
7da93e2617 builtin functions: don't mix up multiple arguments
This regressed in 2e38cf2a which is contained in 2.6.0.

Fixes #7515
2020-11-29 06:35:02 +01:00
Fabian Homborg
5872f4522d math: Add --base option
Currently a bit limited, unfortunately printf's `%a` specifier is
absolutely unreadable.

So we add `hex` and `octal` with `0x` and `0` prefixes respectively,
and also take a number but currently only allow 16 and 8.

The output is truncated to integer, so scale values other than 0 are
invalid and 0 is implied.

The docs mention this may change.
2020-11-27 19:33:27 +01:00
ridiculousfish
a434ec0e19 Remove '--import' from regex string match tests
The '--import' flag was used for importing named capture groups, but it
was decided to always import them unconditionally. This flag was causing
the tests to fail.
2020-11-26 16:27:57 -08:00
Mahmoud Al-Qudsi
edb7897b4d Add tests for regex variable import 2020-11-26 14:41:31 -06:00
Fabian Homborg
a14e64ed6c math: Don't override errors with "unexpected token"
As always, we want to give the most specific error we can.

Fixes #7508
2020-11-26 12:41:19 +01:00
ridiculousfish
5f16a299a7 Use external mode for term when running key bindings
Prior to this fix, when key binding is a script command (i.e. not a
readline command), fish would run that key binding using fish's shell
tty modes. Switch to using the external tty modes. This re-fixes
issue #2214.
2020-11-23 19:36:39 -08:00
ridiculousfish
21e2b39fa8 Add a sleep to bind.py
With the upcoming fix to place the tty in external-proc mode, add a sleep
which resolves a race between emitting a newline and restoring it to shell
mode.
2020-11-23 19:36:39 -08:00
ridiculousfish
db514df95b Stop setting tty back to shell mode when a fg proc completes
Prior to this change, when a process resumes because it is brought back
to the foreground, we would reset the terminal attributes to shell mode.
This fixed #2114 but subtly introduced #7483.

This backs out 9fd9f70346, re-introducing #2114 and re-fixing #7483.
A followup fix will re-fix #2114; these are broken out separately for
bisecting purposes.

Fixes #7483.
2020-11-23 19:36:39 -08:00
Fabian Homborg
2e55e34544 Reformat 2020-11-22 14:39:48 +01:00
Fabian Homborg
61d322d403 Cleanup test setup a bit
Put the env setup into test_util, which does some additional work.

Also use some more builtins and stuff.
2020-11-15 09:17:23 +01:00
Fabian Homborg
78bb1a6fa6 Remove some unused functions from the test harness
This was from before `string` was a thing - `_quote` would be better
done as `string escape` and `_echo_var` would be `set --show`.
2020-11-15 09:17:23 +01:00
Fabian Homborg
e6cdd315d1 tests/generic: Check for a literal match
I *think* this might sometimes (on CI) be eating the prompt, so that the actual `prompt`
part of `expect_prompt` doesn't find anything.

On Github Actions we see things like:

```
Testing file pexpects/generic.py ... Failed to match pattern: prompt 5
generic.py:35: timeout from expect_prompt("echo .history.*")

[...]

OUTPUT      +1.08 ms (Line 31): \rprompt 4>
 INPUT      +0.35 ms (Line 34): echo $history[1]\n
OUTPUT      +1.58 ms (Line 35): echo $history[1]\r\necho $history[1]\r\n⏎                                                                              \r⏎ \r\rprompt 5>
```

so the prompt *is* printed, it's just not correctly matched.
2020-11-13 15:20:37 +01:00
Fabian Homborg
5e91e5127d Remove reference to Travis
I'm still salty about that exit.
2020-11-13 15:12:14 +01:00
Fabian Homborg
4c9d01cab0 Fix fg tests on macOS
Apparently on macOS SIGTSTP (from control-Z) causes `read()` to return
EINTR.

This means `cat | cat` will exit as soon as it's backgrounded and
brought back.

So instead we use `sleep`, which won't read(), and therefore is
impervious to these puny attacks.

See discussion in #7447.
2020-11-13 15:11:29 +01:00
Fabian Homborg
25823d2900 And another delay change
Monty Python this ain't.
2020-11-11 19:57:29 +01:00
Fabian Homborg
ae0c68ec7e Tests: Yet another delay change
Now this failed because the CI added 90ms of delay.

*sigh*
2020-11-11 19:20:55 +01:00
Fabian Homborg
eed70d719a tests: More slack
The classic mistake: Some of these have a bit of a delay, but it's supposed to
be *under* the timeout, so it needs to be *shorter* not longer to
increase the slack.
2020-11-09 19:56:53 +01:00
Fabian Homborg
a52bf1d078 tests: Use math for the prompt counter 2020-11-09 19:42:46 +01:00
Fabian Homborg
9b0bec59ae tests: Use python-level kill in job_summary tests
Also increase the `sleep` time.

This *might* help with Github Actions, I'm not entirely sure why this
is failing?
2020-11-09 19:42:19 +01:00
Fabian Homborg
fd66b66a86 tests: Retry interactive tests once
We used to have this, it helps with resource constrained CI systems
2020-11-09 19:26:27 +01:00
Fabian Homborg
2318d037ac tests: Increase timeouts even more
Wow the github actions machines are *slow*
2020-11-09 19:10:24 +01:00
Fabian Homborg
b0f338cf14 Fix error message in tests
Switching from the old debug() to flog causes a shift from

<E> fish:

to

error:

and in this one place we still test it.
2020-11-07 22:48:13 +01:00
Fabian Homborg
e73929b2c6 tests/bind: Increase another delay
I don't understand why, but somehow this waited 101ms and then acted
as if it was under 80ms?
2020-11-07 07:54:06 +01:00
Fabian Homborg
f58f2e14a3 tests/bind: Increase escape delay
We just had the following output on Github Actions:

 INPUT      +0.94 ms (Line 34): echo ghi jkl
 INPUT      +0.72 ms (Line 35): \x1b
 INPUT     +63.12 ms (Line 37): t\r

The default escape delay is 30ms, that had 60ms between an escape and
a tab, so it missed it.

So: We have to increase the delay for CI's benefit. Let's try with
80ms, because otherwise we'd have to bump up other timeouts and the
bind tests take long enough as it is.
2020-11-07 07:44:03 +01:00
Fabian Homborg
69ab68d856 tests: Increase another timeout
Github Action's macOS builds are even more resource-starved (even tho
they use the same provider?) than
Travis, but Travis is unusable to us now, so....
2020-11-06 17:56:38 +01:00
Sean Wei
ca0f5686ff Fix typo 2020-10-31 13:27:05 +01:00
Fabian Homborg
d334dc6643 Let cancel after an unambiguous completion was accepted undo it
In some cases the completion we come up with may be unexpected, e.g.
if you have files like

/etc/realfile

and

/etc/wrongfile

and enter "/etc/gile", it will accept "wrongfile" because "g" and
"ile" are in there - it's a substring insertion match.

The underlying cause was a typo, so it should be easy to go back.

So we do a bit of magic and let "cancel" undo, but only right after a
completion was accepted via complete or complete-and-search.

That means that just reflexively pressing escape would, by default, get you back to
the old token and let you fix your mistake.

We don't do this when the completion was accepted via the pager,
because 1. there's more of a chance to see the problem there and 2.
it's harder to redo in that case.

Fixes #7433.
2020-10-30 19:37:44 +01:00
Fabian Homborg
a84d57b02b math: Actually report closing paren error
This was typically overridden by "too many/few arguments", but it's
actually incorrect:

    sin(55

has the correct number of arguments to `sin`, but it's lacking
the closing `)`.
2020-10-26 18:13:43 +01:00
Mahmoud Al-Qudsi
9fb6a4ea9d Re-use xdg_ directories in test_util 2020-10-25 23:07:46 -05:00
Mahmoud Al-Qudsi
a29b5b6e8f Run __fish_complete_entries test in its own sandbox
It was being unduly influenced by any files created for or by other
tests in the fish config/home directories.
2020-10-25 23:01:51 -05:00
Fabian Homborg
06bd1e9347 tests: Check that ctrl-z can be bound
We've heard news of this regressing, so let's add the test that should
have been there already (mea culpa!).

Because we now use POSIX_VDISABLE, this should also work in tandem
with ctrl-space (which sends NUL), but we can't test *that* because
some systems might not have POSIX_VDISABLE.
2020-10-14 19:26:13 +02:00
Johannes Altmanninger
c325603d73 Honor variable assignments on the commandline when completing files
This had already worked before although the implementation used to be rather
crude and was cleaned up in
e88eb508d0 (r42759188)
2020-10-10 12:59:55 +02:00
Johannes Altmanninger
eca2a8ba55 complete: print completions without the implied -c switch
This switch is no longer necessary when only one command is given.
Internally completions are stored separately for each command,
so we only every print one command name per "complete" line anyway.
2020-10-10 11:54:52 +02:00
Johannes Altmanninger
f20e8e5860 alias: don't add --wraps for wrappers with the same name
These aliases seem to be common, see #7389 and others.  This prevents
recursion on that example, so `alias ssh "env TERM=screen ssh"` will just
have the same completions as ssh.

Checking the last token is a heuristic which hopefully works for most
cases. Users are encouraged to use functions instead of aliases.
2020-10-10 09:24:49 +02:00
ridiculousfish
e9902159c2 Send fish_cancel event on control-C again
This adds support for sending fish_cancel, and a test for it.
Fixes #7384.
2020-10-06 17:49:55 -07:00
ridiculousfish
63cf3e972f Correct parameter order of pexpect.expect_prompt
Ensure that the increment= param is set via keyword, not via positional arg.
This mistake was masking a bug where the "^a b c" match was not being tested,
because it was being set as the value for increment!
2020-10-06 16:03:06 -07:00
ridiculousfish
9e1800cb96 Rework increment param in pexpect.expect_prompt
This switches the 'increment' param from "after" to "before." Instead
of expect_prompt saying if the next prompt will be incremented, each
call site says if it should have been incremented sinec the last prompt.
2020-10-06 14:22:35 -07:00
Fabian Homborg
f6bba5ceb4 tests: Pass $fish as a variable in some cases
I am not sure why this worked, actually.

These tests did not have $fish set anywhere, and on my fresh OpenBSD
VM it ended up calling whatever that calls "fish" (I think it's that
"Go fish!" game?).
2020-10-06 17:40:22 +02:00
Fabian Homborg
ad789d4242 Fix type test if system doesn't have realpath
The description changes
2020-10-04 19:41:24 +02:00
Fabian Homborg
135c5a9746 abbr: Don't write an error if erasing nonexisting abbrs
Fixes #7376.
2020-10-04 12:34:38 +02:00
Fabian Homborg
2ab4c10c47 abbr: Allow erasing multiple
Fixes #7377.
2020-10-04 12:27:59 +02:00
Fabian Homborg
00ab51bedc set: Allow erasing multiple variables at once
See #7377.
2020-10-04 12:24:11 +02:00
Johannes Altmanninger
3002c88f44 Set fish_emoji_width in test to guard against older wcwidth
See #7340
2020-09-28 18:09:39 +02:00
Fabian Homborg
dfcb4b811c tests: Regex the width tests
Some wcwidths are old.

Belongs to #7340.
2020-09-28 17:48:42 +02:00
Johannes Altmanninger
f758d39535 string pad: handle padding characters of width > 1
If the padding is not divisible by the char's width without remainder,
we pad the remainder with spaces, so the total width of the output is correct.

Also add completions, changelog entry, adjust documentation, add examples
with emoji and some tests.  Apply some minor style nitpicks and avoid extra
allocations of the input strings.
2020-09-27 21:59:15 +02:00
Andrew Prokhorenkov
92511b09c4 New command "string pad" to pad text to a given width (#7340)
Pads text to a given width, or the maximum width of all inputs.
2020-09-27 21:59:15 +02:00
Fabian Homborg
689e96263e tests: Add yet another sleep 2020-09-27 09:22:45 +02:00
ridiculousfish
e88eb508d0 Rework variable assignments during tab completion
Prior to this change, tab completing with a variable assignment like
`VAR=val cmd<tab>` would parse out and apply VAR=val, then recursively
invoke completions. This caused some awkwardness around the wrap chain -
if a wrapped command had a variable completion we risked infinite
recursion. A secondary problem is that we would run any command
substitutions inside variable assignment, which the user does not expect
to run until pressing enter.

With this change, we explicitly track variable assignments encountered
during tab completion, including both those explicitly given on the
command line and those found during wrap chain walk. We then apply them
while suppressing command substitutions.
2020-09-26 18:39:38 -07:00
ridiculousfish
cc07716dc1 Separate out variable assignments when completing
In preparation for applying variable assignments (VAR=VAL cmd), separate
them out from the command when performing completions. This includes both
those that the user typed, and any that come about through
completion --wraps.
2020-09-26 17:30:25 -07:00
ridiculousfish
45b85d28bb Completion wrap chain visited set to store only wrapped command
The "wrap chain" refers to a sequence of commands which wrap other
commands, for completion purposes. One possibility is that a wrap chain
will produce a combinatorial explosion or even an infinite loop, so there
needs to be logic to prevent that. Part of that logic is encapsulated in a
visited set (wrap_chain_visited_set_t) to prevent exploring the same item
twice.

Prior to this change, we stored pairs (command, wrapped_command). But we
only really need to store the wrapped command. Switch to that.

One consequence is that if a command wraps another command in more than
one way, we won't explore both ways. This seems unlikely in practice.
2020-09-26 17:24:59 -07:00
Fabian Homborg
f708632ca3 tests: Remove test for windows line ending message
This is flaky on launchpad for some reason, and it's really not
important enough to hold it up.

So let's just leave this untested.
2020-09-26 15:19:24 +02:00
Fabian Homborg
caccc0cddb Add more tests for -c arguments 2020-09-26 15:19:24 +02:00
Johannes Altmanninger
45e7c709f4 Consolidate complete cycle detection and always report error on cycle
Detect recursive calls to builtin complete and the internal completion in
the same place.

In 0a0149cc2 (Prevent infinite recursion when completion wraps variable assignment)
we don't print an error when completing certain aliases like:

	alias vim "A=B vim"

But we also gave no completions.
We could make this case work, but I think that trying to salvage situations
like this one is way too complex. Instead, let the user know by printing an
error. Not sure if the style of the error fits.

We could add some heuristic to alias to not add --wraps in some cyclic cases.
2020-09-26 14:56:03 +02:00
Johannes Altmanninger
f415b3b551 Update littlecheck
4a3e4c8 Allow inline #CHECK directives and ignore double-commented directives
2020-09-26 14:56:03 +02:00
Fabian Homborg
fa0c9f90f8 Read arguments with fish -c
This reads any additional positional arguments given to `fish -c` into
$argv.

We don't handle the first argument specially (as `$0`) as that's confusing and
doesn't seem very useful.

Fixes #2314.
2020-09-26 14:47:20 +02:00
Fabian Homborg
537b3f6cb1 tests/exec: Wait after writing to a file before executing it
Otherwise we might get "text file is busy", or worse no error at all.

Hoping .2 seconds is enough here.
2020-09-26 07:22:17 +02:00
Fabian Homborg
0d0ee473fa Detect windows line endings when executing a file
Fixes #2783.
2020-09-25 16:51:05 +02:00
Fabian Homborg
1188a12dfd type: Print *only* the path if given --path or --force-path
This is what happens when you check your tests in the wrong tab,
folks.

Fixes #7345.
2020-09-23 17:24:51 +02:00
Fabian Homborg
1da56f9937 Make history search smartcase
This makes history searches case-insensitive, unless the search string
contains an uppercase character.

This is what vim calls "smartcase".

Fixes #7273.
2020-09-22 16:13:24 +02:00
Johannes Altmanninger
0a0149cc2a Prevent infinite recursion when completion wraps variable assignment
Closes #7344

Apply a targeted fix to the place where complete() is called to handle nested
variable assignments.  Sadly, reporting an error is probably not okay here,
because people might legitimately use aliases like:

	alias vim "A=B command vim"

This is all a bit ugly, and I hope to find a cleaner solution.  Supporting
completions on commandlines like `x=$PWD cd $x/ ` is a nice feature but it
comes with some complexity.
2020-09-22 01:11:18 +02:00
Fabian Homborg
7934972751 Add some more type tests 2020-09-21 17:45:15 +02:00
Fabian Homborg
e8d725e051 Add tests for type
While we use `type -q` a bunch, the other options are kind of
unutilized, and so having a test is nice when we want to reimplement
it.

See #7342.
2020-09-20 10:36:17 +02:00
Fabian Homborg
7ec57f2c50 string: Handle unmatched capturing groups as empty
Instead of erroring out.

Fixes #7343.
2020-09-20 10:36:17 +02:00
ridiculousfish
5c3571d626 Revert accidental merge of #7340
This reverts back to commit d8e2cac83e.
I accidentally did a 'git push' during code review.
2020-09-19 19:31:44 -07:00
Andrew Prokhorenkov
2afa354c14 builtin_string: implement "width" argument for "string pad" 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
efe94344e2 builtin_string: extra tests 2020-09-19 19:25:57 -07:00
Andrew Prokhorenkov
f389bb0e97 tests: added tests for "string pad" 2020-09-19 19:25:57 -07:00
Fabian Homborg
a3e20a4d38 Don't use abbreviated long options
"function --argument" is not a thing, it's "--argument-names". This only
accidentally works because our getopt is awful and allows abbreviated
long options.

Similarly, one argparse test used "--d" instead of "-d" or "--def".
2020-09-19 11:47:41 +02:00
Fabian Homborg
58245b6fe7 set_color: Honor modifiers (bold, background..) with --print-colors
Fixes #7314
2020-09-17 12:33:56 +02:00
Fabian Homborg
e86a31f6d4 Use the newly fixed test -t in isatty
Removes a weird dependency on the test command.
2020-09-16 21:02:59 +02:00
Fabian Homborg
709e91c1e6 builtin test: Let -t work for the standard streams
Since builtins don't actually have the streams connected, but instead
read input via the io_streams_t objects, this would just always say
what *fish's* fds were.

Instead, pass along some of the stream data to check those
specifically - nobody cares that `test`s fd 0 *technically* is stdin.
What they want to know is that, if they used another program in that
place, it would connect to the TTY.

This is pretty hacky - I abused static variables for this, but
since it's two bools and an int it's probably okay.

See #1228.

Fixes #4766.
2020-09-16 21:02:59 +02:00
ridiculousfish
1fd9debaad jobs test to detect zombies before running
If there is any zombie process, the jobs.fish test will fail. Add an
explicit check to report when this happens.
2020-09-13 19:28:14 -07:00
ridiculousfish
1ba9c7ea56 Use temporary files for the background job pgroup test
This also reduces the likelihood of a race.
2020-09-13 15:36:26 -07:00
ridiculousfish
a698b1f96c Reenable pgroup eval test in more robust form
This re-enables the test that eval retains pgroups, from #6806.
The old version was racey and failed a lot. In the new version, we use
temp files to resolve the race.
2020-09-13 13:44:35 -07:00
Fabian Homborg
0072367512 fish_add_path: Don't resolve symlinks
The case for symlinked directories being duplicated a lot isn't there,
but there *is* a usecase for adding the symlink rather than the
target, and that's homebrew.

E.g. homebrew installs ruby into /usr/local/Cellar/ruby/2.7.1_2/bin,
and links to it from /usr/local/opt/ruby/bin. If we add the target, we
would miss updates.

Having path entries that point to the same location isn't a big
problem - it's a path lookup, so it takes a teensy bit longer. The
canonicalization is mainly so paths don't end up duplicated via weird
spelling and so relative paths can be used.
2020-09-12 19:28:01 +02:00
Fabian Homborg
568f9031aa builtin realpath: Add --no-symlinks option
Taken from GNU realpath, this one makes realpath not resolve symlinks.

It still makes paths absolute and handles duplicate and trailing
slashes.

(useful in fish_add_path)
2020-09-12 19:26:04 +02:00
Fabian Homborg
0e9b496bba Fix bigword bindings with single-character words
With a commandline like

```
a b c d
```

and the cursor at the beginning, this would eat "a b", which isn't a
sensible bigword.

Bigword should be "a word, with optional leading whitespace".

This was caused by an overly zealous state-machine that always ate one
char and only *then* started eating leading whitespace.

Instead eat *a character*, and if it was whitespace go on eating
whitespace, and if it was a printable go straight to only eating
printables.

Fixes #7325.
2020-09-11 20:13:06 +02:00
Fabian Homborg
30b2dc2b97 Don't enqueue a repaint in the middle of one
This can easily lead to an infinite loop, if a variable handler
triggers a repaint and the variable is set in the prompt, e.g. some of
the git variables.

A simple way to reproduce:

    function fish_mode_prompt
        commandline -f repaint
    end

Repainting executes the mode prompt, which triggers a repaint, which
triggers the mode prompt, ....

So we just set a flag and check it.

Fixes #7324.
2020-09-11 19:23:26 +02:00
Fabian Homborg
903b7888d3 complete: Make -c optional
Currently, completions have to be specified like

```fish
complete -c foo -l opt
```

while

```fish
complete foo -l opt
```

just complains about there being too many arguments.

That's kinda useless, so we just assume if there is one left-over
argument that it's meant to be the command.

Theoretically we could also use *all* the arguments as commands to
complete, but that seems unlikely to be what the user wants.

(I don't think multi-command completions really happen)
2020-09-09 20:23:08 +02:00
Fabian Homborg
a8e237f0f9 Let complete show completions for one command if just given -c
Currently only `complete` will list completions, and it will list all
of them.

That's a bit ridiculous, especially since `complete -c foo` just does nothing.

So just make `complete -c foo` list all the completions for `foo`.
2020-09-09 18:37:39 +02:00
Fabian Homborg
fbe56a84c7 tests: Export $TERM
I think this might be causing problems on Github CI.
2020-09-06 11:15:54 +02:00
Fabian Homborg
340de73172 Call "fish_command_not_found" if a command wasn't found
Previously, when a command wasn't found, fish would emit the
"fish_command_not_found" *event*.

This was annoying as it was hard to override (the code ended up
checking for a function called `__fish_command_not_found_handler`
anyway!), the setup was ugly,
and it's useless - there is no use case for multiple command-not-found handlers.

Instead, let's just call a function `fish_command_not_found` if it
exists, or print the default message otherwise.

The event is completely removed, but because a missing event is not an error
(MEISNAE in C++-speak) this isn't an issue.

Note that, for backwards-compatibility, we still keep the default
handler function around even tho the new one is hard-coded in C++.

Also, if we detect a previous handler, the new handler just calls it.

This way, the backwards-compatible way to install a custom handler is:

```fish
function __fish_command_not_found_handler --on-event fish_command_not_found
    # do a little dance, make a little love, get down tonight
end
```

and the new hotness is

```fish
function fish_command_not_found
    # do the thing
end
```

Fixes #7293.
2020-09-06 11:15:54 +02:00
Fabian Homborg
4817f97823 tests: Print some more info in the job_summary test for debugging
This one fails a bunch on CI and I have no idea why.
2020-09-04 17:53:17 +02:00
Fabian Homborg
bfb5b28d0f Let command, jobs and type take --query instead of --quiet
Now command, jobs, type, abbr, builtin, functions and set take `-q` to
query for existence, but the long option is inconsistent.

The first three use `--quiet`, the latter use `--query`. Add `--query`
to the first three, but keep `--quiet` around.

Fixes #7276.
2020-09-04 16:55:09 +02:00
Fabian Homborg
6ca2dbecfb Remove duplicated test
Fixes #7307.
2020-09-04 16:30:13 +02:00
Fabian Homborg
3fcf4e1b20 tests: Shorten a sleep
This waited for a full second just to call `wait`.

Instead let's use 300ms, saving a full 700ms per test run.
2020-09-04 16:29:53 +02:00
ridiculousfish
30d0315b60 Add a test that fish_exit handlers run on receipt of SIGHUP 2020-08-30 15:09:34 -07:00
ridiculousfish
0379f21870 Correctly cancel on receipt of SIGHUP
When we receive SIGHUP, stop executing normal fish script (but allow
exit handlers to run).
2020-08-30 15:09:34 -07:00
Fabian Homborg
5b1c000a2e math: Add bitwise and/or functions
Just as `math "bitand(5,3)"` and `math "bitor(6,2)"`.

These cast to long long before doing their thing,
so they truncate to an integer, producing weird results with floats.

That's to be expected because float representation is *very*
different, and performing bitwise operations on floats feels quite useless.

Fixes #7281.
2020-08-26 17:48:58 +02:00
ridiculousfish
47480b2dbd Remove redraw coalescing logic
Prior to this change, if we saw more than one repaint readline command in
a row, we would try to ignore the second one. However this was never the
right thing to do since sometimes we really do need to repaint twice in a
row (e.g. the user hits Ctrl+L twice). Previously we were saved by the
buginess of this mechanism but with the repainting refactoring we see
missing redraws.

Remove the coalescing logic and add a test. Fixes #7280.
2020-08-24 13:22:35 -07:00
ridiculousfish
073334f307 Stop setting TERM in history test
Because TERM was set to something other than 'dumb', we were subject to
syntax highlighting and other interactive features that would affect the
output. In practice we were getting lucky timing-wise, but with upcoming
interactive changes syntax highlighting started to fail this test.
2020-08-22 19:15:54 -07:00
ridiculousfish
29c1139a6e Correct a missing function call in bind.py
Unclear why this test was passing...
2020-08-22 17:48:50 -07:00
Johannes Altmanninger
19943576e4 fish_indent: preserve semis in if and while conditions
It could be nice to use a heuristic for this in future, but for now let's
stick to the old behavior so we can keep formatting scripts without occasional
bad formatting changes.

A heuristic could also be used to break lines after |, && or || but I don't
think there is much need for that at the moment.

Closes #7252
2020-08-17 17:40:28 +02:00
ridiculousfish
82fed6fc2f Correctly propagate signals from cancelled jobs into parse_execution_context
This concerns code like the following:

    while true ; sleep 100; end

Here 'while' is a "simple block execution" and does not create a new job,
or get a pgid. Each 'sleep' however is an external command execution, and
is treated as a distinct job. (bash is the same way). So `while` and
`sleep` are always in different job groups.

The problem comes about if 'sleep' is cancelled through SIGINT or SIGQUIT.
Prior to 2a4c545b21, if *any* process got a SIGINT or SIGQUIT, then fish
would mark a global "stop executing" variable. This obviously prevents
background execution of fish functions.

In 2a4c545b21, this was changed so only the job's group gets marked as
cancelled. However in the case of one job group spawning another, we
weren't propagating the signal.

This adds a signal to parse_execution_context which the parser checks after
execution. It's not ideal since now we have three different places where
signals can be recorded. However it fixes this regression which is too
important to leave unfixed for long.

Fixes #7259
2020-08-13 15:30:15 -07:00
ridiculousfish
d3f8445bcb Fix the job_summary pexpect test on Mac
Macs don't have a CPU column in jobs.
2020-08-12 16:40:32 -07:00
Fabian Homborg
c46489bde8 tests/job_summary: Add jobs call
Might help figuring out where this times out on CI?

We're waiting *20 seconds* for the output to appear, there's no way
that's too slow. So maybe we're going too fast elsewhere?
2020-08-12 18:38:15 +02:00
Fabian Homborg
1c6953ce79 tests/signals: Add missing sys import
This was only used if it failed for sys.exit(1)
2020-08-12 18:38:15 +02:00
Fabian Homborg
a7305c7082 tests: Increase timeout for signals test 2020-08-10 22:03:51 +02:00
ridiculousfish
8301aa9929 Add a test that nohup works
If fish is invoked with nohup, then its children should be nohup too.
2020-08-10 12:26:30 -07:00
Johannes Altmanninger
563a2d824c fish_indent: indent comments before line continuation
See #7252
2020-08-09 23:59:30 +02:00
Johannes Altmanninger
f8f32628a6 fish_indent: no extra newline at comment after pipe
Fixes the unstable case in #7252
2020-08-09 23:59:30 +02:00
Johannes Altmanninger
14a66fad64 Use variable in tests/checks/indent.fish 2020-08-09 23:53:46 +02:00
ridiculousfish
f6c1ef58df Indent continuations after | and &&
This indents continuations after pipes and conjunctions if they contain
a newline.

Example:

    cmd1 &&
        cmd2

But it avoids the "double indent" if it indented unconditionally:

    cmd1 | begin
        cmd2
    end

More work towards improving #7252
2020-08-09 12:22:15 -07:00
ridiculousfish
9a53bf7d56 fish_indent: indent line continuations
For example:

    cmd \
        arg

Fixes one case from #7252
2020-08-09 12:22:14 -07:00
ridiculousfish
e2a26b2fdf fish_indent: Correct certain comment indenting
Prior to this change, when emitting gap text (comments, newlines, etc),
fish_indent would use the indentation of the text at the end of the gap.
But this has the wrong result for this case:

    begin
    command
    # comment
    end

as the comment would get the indent of the 'end'. Instead use the indent
computed for the gap text itself.

Addresses one case of #7252.
2020-08-09 12:22:05 -07:00
Fabian Homborg
2cdd6df257 fish_indent: Add a "--check" option to only test indentation
Fixes #7251.
2020-08-08 20:23:14 +02:00
Fabian Homborg
b4f5ba6537 tests: Exit: Try sleeping multiple times 2020-08-08 16:35:08 +02:00
Fabian Homborg
7c0ecf0d37 Increase job summary timeout more in one call 2020-08-08 16:35:08 +02:00
Fabian Homborg
46faf0869c tests: Stop sleeping before expect
It's useless - `expect` has a timeout anyway, and it defaults to 5s,
so these 0.5s sleeps just mean it'll always take at least 0.5s.

Sometimes it is useful to let things settle before *sending* text, and
it would be nice to be able to set the timeout for each expect
separately, but just adding to the timeout isn't useful.
2020-08-08 16:35:08 +02:00
Fabian Homborg
7de333f839 tests: jobs: Sleep more
This one sometimes fails with a zombie detected, so I'm assuming it's
too fast for reaping to happen, so we add another 100ms sleep.

Yeah, this isn't great but...eh
2020-08-08 16:35:08 +02:00
Fabian Homborg
05ddbb1d2e tests: Add an additional "sleep"
This sometimes fails on Travis because sending things to the
background can take a while
2020-08-08 16:35:08 +02:00
Fabian Homborg
f63d70298f tests: Use ps -o stat instead of "state"
Oh, Alpine
2020-08-07 21:06:16 +02:00
Johannes Altmanninger
b947e360db Allow newlines after && and ||
We do the same for pipes (#1285). This matches POSIX sh behavior.
2020-08-06 21:24:26 +02:00
Soumya
539e6fe8b1 Return no status from successful variable assignments 2020-08-05 12:23:49 -07:00
Soumya
a2b2bcef6e Add a $status_generation variable that's incremented for each interactive command that produces a status.
This can be used to determine whether the previous command produced a real status, or just carried over the status from the command before it. Backgrounded commands and variable assignments will not increment status_generation, all other commands will.
2020-08-05 12:23:49 -07:00
ridiculousfish
290236f7e7 Attempt to fix the fg pexpect test
Hypothesize that ^Z is being sent too quickly and add a sleep.
2020-07-31 15:31:55 -07:00
ridiculousfish
c35fe879c7 Bravely remove reclaim... param from continue_job, and rework tcsetpgrp calls
This changes how fish attempts to protect itself from calling tcsetpgrp() too
aggressively. Recall that tcsetpgrp() will "force" itself, if SIGTTOU is
ignored (which it is in fish when job control is enabled).

Prior to this fix, we avoided SIGTTINs by only transferring the tty ownership
if fish was already the owner. This dated from a time before we had really
nailed down how pgroups should be assigned. Now we more deliberately assign a
job's pgroup so we don't need this conservative check.

However we still need logic to avoid transferring the tty if fish is not the
owner. The bad case is when job control is enabled while fish is running in the
background - here fish would transfer the tty and "steal" from the foreground
process.

So retain the checks of the current tty owner but migrate them to the point of
calling tcsetpgrp() itself.
2020-07-27 14:51:37 -07:00
Fabian Homborg
84b25855b0 alias: Escape the first word again
See https://stackoverflow.com/questions/63115744/alias-with-spaces-and-arguments-in-fish-3

This was broken in 115892ccd2
2020-07-27 17:19:44 +02:00
David Adam
2c5d4937e3 disown: add tests for disowned jobs in scripts 2020-07-25 20:38:59 -05:00
Fabian Homborg
a30630a1df Add some rudimentary fg tests
See #5451
2020-07-21 20:31:32 +02:00
Fabian Homborg
825f821623 Pexpects: Increase a timeout
This failed on sr.ht's FreeBSD machines once.
2020-07-21 20:27:55 +02:00
Fabian Homborg
276c76a363 Test alias with a --option
Closes #4756.
2020-07-14 21:08:47 +02:00
Fabian Homborg
9256f37e9e Add test for redirection to variable
Closes #6443
2020-07-14 20:55:38 +02:00
Fabian Homborg
fec3a593a2 test.fish: Erase more environment variables
Unfortunately this doesn't quite fix the issue with Pantheon
Terminal (#7913), as that somehow manages to re-set $VTE_VERSION by
the time littlecheck runs.
2020-07-13 20:55:39 +02:00
ridiculousfish
886603b2ca Adopt the new AST in fish_indent
This switches fish_indent from parsing with parse_tree
to the new ast.

This is the most difficult transition because the new ast retains less
lexical information than the old parse tree. The strategy is:

1. Use parse_util_compute_indents to compute indenting for each token.

2. Compute the "gap text" between the text of significant tokens. This
contains whitespace, comments, etc.

3. "Fix up" the gap text while leaving the significant tokens alone.
2020-07-04 14:58:05 -07:00
Mahmoud Al-Qudsi
f0580b4970 [tests] Fix test to reflect whitespace changes to error message 2020-06-25 23:19:44 -05:00
Mahmoud Al-Qudsi
d0afae46ce [tests] Do not rely on env output to be sorted alphabetically 2020-06-25 21:41:06 -05:00
Fabian Homborg
149a0b98af Another formatting run
I really kinda hate how insistent clang-format is to have line
breaks *IFF THE LINE IS TOO LONG*.

Like... lemme just add a break if it looks better, will you?

But it is the style at this time, so we shall tie an onion to our
belt.
2020-06-24 20:43:56 +02:00
Fabian Homborg
a121833e88 argparse: Only print stacktrace when it's an error in argparse usage
A broken/missing optspec or `--` is a bug in the script using
argparse, an unknown option or invalid argument is a bug in using that script.

So in the former case print a stacktrace, because the person writing
the `argparse` call is at fault, in the latter don't.

Fixes #6703.
2020-06-17 20:05:48 +02:00
Fabian Homborg
00f7cdae62 tests: Don't send \cA
Breaks the tests in screen.

Fixes #7111.
2020-06-17 15:55:31 +02:00
Fabian Homborg
52a6574751 tests: Use status dirname 2020-06-14 19:30:03 +02:00
Fabian Homborg
e0f5fc2cb4 Remove some leftover test files 2020-06-13 20:43:12 +02:00
Fabian Homborg
aa7316b6c6 checks/read: Print maximum if we fail to read it
Debugging here is a bit difficult.
2020-06-13 19:53:21 +02:00
Fabian Homborg
87a1e4f8b9 Remove expect
This should remove the last bits of expect from the codebase.
2020-06-13 19:28:42 +02:00
Fabian Homborg
c6dffa226f Port history test to pexpect 2020-06-13 19:24:36 +02:00
Fabian Homborg
51e3258dbe Port histfile test to pexpect 2020-06-13 18:53:01 +02:00
Fabian Homborg
25a73a77bb Unset X-bit on tests
These files are not expected to be run directly.
2020-06-13 16:18:17 +02:00
Fabian Homborg
93c3aaf5f4 Port signals test to pexpect 2020-06-13 15:38:54 +02:00
Fabian Homborg
c11457f2db Port job_summary test to pexpect 2020-06-13 15:21:40 +02:00
Fabian Homborg
a6a1c6e775 Port read tests to expect
Note: This includes a super cheesy thing to print variable contents.
The expect version has one that's a bit more elaborate (featuring a
marker setup), but tbh that doesn't seem to be worth it.

If we do need it, we can add it, but it seems more likely we'd just do
`set -S`, or do it in a check instead.
2020-06-13 15:21:40 +02:00
Fabian Homborg
aafdaea2f9 Port wait test to pexpect 2020-06-13 15:21:40 +02:00
Fabian Homborg
15a789dda0 Fix fkr tests
I had fish_key_reader *installed*, so this worked for me.

But really we have the path in $fish_key_reader, so we want to use
that variable.
2020-06-08 23:19:57 +02:00
Fabian Homborg
f66edfdec2 Port generic.expect to pexpect
Removes a dumb workaround. Huzzah!
2020-06-08 22:57:46 +02:00
Fabian Homborg
339a5a2196 Port fkr expect to pexpect 2020-06-08 22:52:18 +02:00
Fabian Homborg
cbefdb775d tests: Sleep for a bit
Gosh dangit Travis
2020-06-08 18:49:03 +02:00
Fabian Homborg
83808929a7 Remove pipestatus expect test
This doesn't really do more than the check of the same name.
2020-06-08 17:34:43 +02:00
Fabian Homborg
10fbdd34e7 Reformat pexpects
These are now python scripts
2020-06-08 17:33:04 +02:00
Fabian Homborg
3c6055c3e0 Move exit test to pexpect
This needs some subprocess magic, but otherwise it's nicely straightforward.
2020-06-08 17:31:18 +02:00
Fabian Homborg
9d523c7589 Move complete test to pexpect 2020-06-08 17:16:09 +02:00
Fabian Homborg
927aa60349 Move bind_mode_events test to pexpect 2020-06-08 17:12:49 +02:00
Fabian Homborg
7076880da9 Move commandline test to pexpect 2020-06-08 17:09:29 +02:00
ridiculousfish
8a27873598 Remove redundant expect tests
With the new pexpect based framework, bind and pipeline expect tests can
be removed.

Amusingly the complete.fish check required the existence of bind.expect.
Fix the check at the same time.
2020-06-07 14:53:17 -07:00
ridiculousfish
4ae4314e63 Improve pexpect output
Make it easier to use pexpect and to understand its error messages.
Switch to a style in tests using bound methods, which makes them
less noisy to write.
2020-06-07 14:53:17 -07:00
ridiculousfish
3b7feb38e9 Add pexpect-based interactive testing framework
This adds a new interactive test framework based on Python's pexpect. This
is intended to supplant the TCL expect-based tests.

New tests go in `tests/pexpects/`. As a proof-of-concept, the
pipeline.expect test and the (gnarly) bind.expect test are ported to the
new framework.
2020-06-07 14:46:21 -07:00
Fabian Homborg
9d2bf248ee test: Add tests for error messages 2020-06-07 16:23:29 +02:00
Fabian Homborg
44184f68e4 Add status dirname and status basename convenience commands
There's a terrible number of fishscripts that start with

    set path (dirname (status filename))

And that's really just a bit boring.

So let's let it be

    set path (status dirname)
2020-06-04 18:23:32 +02:00
Fabian Homborg
90b01fd915 set: Show pathvariableness in --show 2020-06-01 15:51:10 +02:00
Fabian Homborg
9354dd6971 Add fish_add_path, a simple way to add to $PATH
This is a function you can either execute once, interactively, or
stick in config.fish, and it will do the right thing.

Some options are included to choose some slightly different behavior,
like setting $PATH directly instead of $fish_user_paths, or moving
already existing components to the front/back instead of ignoring
them, or appending new components instead of prepending them.

The defaults were chosen because they are the most safe, and
especially because they allow it to be idempotent - running it again
and again and again won't change anything, it won't even run the
actual `set` because it skips that if all components are already in.

Fixes #6960.
2020-05-29 20:51:05 +02:00
Fabian Homborg
7cb452c7e7 Computed variables are global
Variables like $status and $history showed up in all scopes, including
universal, when querying with `set -q` or `set -S`.

This makes it so they all only count as set in global scope, because
we already only allow assignment to electric variables in global scope.

Fixes #7032
2020-05-27 19:59:20 +02:00
Soumya
518170b299 Also call fish_job_summary for foreground sigint
The default implementation will not print any output in that case, but this provides users with additional flexibility when it comes to customising the shell's behaviour.
2020-05-19 20:39:10 +02:00
Soumya
324fa64114 Add fish_job_summary, called whenever a job ends, stops, or is signalled
This allows users to customise the behaviour of the shell by redefining the function. This is similar to how fish_title or fish_greeting behave, where the default implementation can be easily overridden.

The function receives as arguments the job id, command line, signal name and signal description.
2020-05-19 20:39:10 +02:00
Fabian Homborg
56f24f08d7 printf: Don't print an error if not given an argument 2020-05-18 20:48:36 +02:00
Johannes Altmanninger
e03c375ee3 Purge remnants of process expansion, document {fish,last}_pid 2020-05-16 11:58:12 +02:00
Johannes Altmanninger
49c5f96470 Use set -l to force use of a local variable
Bare set overwrites a global/universal variable if it exists.
2020-05-15 08:25:07 +02:00
Fabian Homborg
e390ee12c2 Disable flaky pipeline-pgroup test
This fails *a lot* on Travis, obscuring other tests.

As far as we can tell, a newline is somehow sneaking in here.

See #6693
2020-05-07 21:19:28 +02:00
ridiculousfish
82f2d86718 Thread pgroups into builtin_eval
Ensure that if eval is invoked as part of a pipeline, any jobs spawned
by eval will have the same pgroup as the parent job.

Partially fixes #6806
2020-04-26 11:05:50 -07:00
ridiculousfish
938b683895 Thread pgroups into command substitutions
Give string expansion an (optional) parent pgroup. This is threaded all
the way into eval(). This ensures that in a mixed pipeline like:

   cmd | begin ; something (cmd2) ; end

that cmd2 and cmd have the same pgroup.

Add a test to ensure that command substitutions inherit pgroups
properly.

Fixes #6624
2020-04-26 11:05:50 -07:00
Fabian Homborg
6990c44443 Shorten set --show output
Changes it from

```
$fish_color_user: not set in local scope
$fish_color_user: set in global scope, unexported, with 1 elements
$fish_color_user[1]: length=3 value=|080|
$fish_color_user: set in universal scope, unexported, with 1 elements
$fish_color_user[1]: length=7 value=|brgreen|

```

(with the trailing empty line - not just a newline)

to

```
$fish_color_user: set in global scope, unexported, with 1 elements
$fish_color_user[1]: |080|
$fish_color_user: set in universal scope, unexported, with 1 elements
$fish_color_user[1]: |brgreen|
```
2020-04-26 08:49:01 +02:00
Jason Nader
6a839519b9 string split: add --allow-empty flag to be used with --fields 2020-04-20 22:39:48 +02:00
Jason Nader
3bb86d3a61 string split --fields: handle multi-line/arg input 2020-04-20 22:39:48 +02:00
Johannes Altmanninger
23427f3168 Add test for ~ (togglecase-char and togglecase-selection) 2020-04-19 05:51:25 +02:00
ridiculousfish
3e8422f472 terminal_maybe_give_to_job to stop returning error on ENOTTY
Prior to this fix, if job control is enabled but stdin is not a tty, we
would return an error from terminal_maybe_give_to_job which would cause us
to avoid waiting for the job. Instead just return notneeded.

Fixes #6573.
2020-04-18 16:26:54 -07:00
Johannes Altmanninger
be36c96028 alias.fish: unbreak listing aliases without backslashes
The description for an alias which already has escape sequences will
use backslash escapes for quoting; usually `string escape` can simply
quote it.  Use a regex that accepts either escaping style.
2020-04-18 09:35:33 +02:00
Johannes Altmanninger
77d33a8eb9 Ignore SIGINT and SIGQUIT in non-interactive background processes
Fixes #6828
2020-04-07 22:18:15 +02:00
Fabian Homborg
f0f162f07e argparse test: Tighten regex against travis' shenanigans
Travis puts the commit message in an environment variable, so if it
contains the string `_flag` this would match TRAVIS_COMMIT_MESSAGE.

That happened in ca91c201c3, so the
tests failed.

We simply tighten the regex a little more, and make a commit message
that doesn't include the string.
2020-04-06 19:57:22 +02:00
Fabian Homborg
5dfaff4281 Make "." a builtin as well
Yeah, it's not going anywhere. This is one line in builtin.cpp vs 9
lines of script, most of which used to print an error that is never triggered.
2020-04-06 18:55:59 +02:00
Jason Nader
21bbd2ecb4 Return 1 if non-existent field is given 2020-04-04 15:30:09 +02:00
Jason Nader
1329a40e87 Allow simple ranges to be specified for --fields 2020-04-04 15:30:08 +02:00
Jason Nader
7cb1d3a646 Add string split --fields 2020-04-04 15:30:08 +02:00
Fabian Homborg
a29bc127ce Move the invocation checks to invocation.fish
These where separate files so we could use the %s substitution to run
that fish, but since discovering setting $fish that
workaround isn't necessary.
2020-04-04 13:31:48 +02:00
Fabian Homborg
d54609bd63 Skip interactive tests on github actions for now
Github actions doesn't run this in a terminal, so the `fish -i` tests won't really work.

But still, it might be nicer than Travis.
2020-04-04 13:31:48 +02:00
Soumya
61a9cdaa74 Add $fish_kill_signal to track the signal that terminated a command.
Set to `0` if the command exited normally.
2020-04-02 09:32:32 +02:00
Fabian Homborg
1c880e5888 tests: Specify which tests completed successfully
It's a bit weird to just see "All tests completed successfully" and
then another set of tests follows.
2020-03-28 18:41:44 +01:00
Fabian Homborg
917f26b1dd tests/interactive.fish: Match littlecheck's coloring
Littlecheck resets the color before the time, which looks a bit nicer.

But most of all, it's inconsistent.
2020-03-28 18:40:57 +01:00
Fabian Homborg
82977f07a0 test.fish: Remove mention of ".in" files 2020-03-28 18:29:21 +01:00
Fabian Homborg
3a1bc33cad tests: Remove leftover reference to "../test/root/bin/fish"
We have that in a variable now.
2020-03-28 15:46:47 +01:00
Johannes Altmanninger
6699a72e0e Handle child receiving SIGCONT
Fixes #6818
2020-03-27 20:30:58 +01:00