Just copy that "find an executable" code we already have,
the one that was commented with "oh, btw, distutils.spawn.find_executable is bad",
and use it here as well.
Work towards #7514.
The code to override the `(status current-command) was present`, but not
handled in either the default `fish_title` function or the fallback.
Closes#7444.
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.
Prior to this change, we would run fish_prompt and then afterwards set
the shell modes. For users with an initially slow prompt, this would
mean that characters would be echoed to the tty until after the prompt
completes.
Reorder these so that we set the tty mode first. This implies we will
run the prompt in shell mode, but this was already the case up until
2a3677b386.
Fixes#7489. Note that the prior commit e0cedd4ad2 is also necessary
here, as that fixed an extra prompt execution.
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.
The new commandline switch `string match --regex --import` will import
as fish variables any named capture groups with the matched captures as
the value(s).
Unfortunately the previous solution was too naive and misidentified
some errors.
In essence, passing regex-source couldn't work, because those could
not match any other line, so we have to inject regex-matching into the
SequenceMatcher.
Through awful hackery, this is possible.
Updates littlecheck to 0f6841bbc1674e89f512b5f19d1ad4e0227d2934.
This is the start of an effort to make it easier to build and run tests in
various Linux environments. The idea is to reduce our reliance on CI and
also allow an easy to way capture tricky environments like musl or gcc 5.
This adds two initial Dockerfiles corresponding to Ubuntu Bionic, and
Ubuntu Bionic with Thread Sanitizer enabled. It also adds a new script
`docker/docker_run_tests.sh`. An example of usage:
docker/docker_run_tests.sh docker/bionic-tsan.Dockerfile
When run, this builds a Docker image (which is cached after the first
build) and sets its entry point to a new script `fish_run_tests.sh`. It
then launches a container with that image, with a directory `/fish-source`
bound to the fish-shell source directory on the host. Note it is a bind
mount, not a copy, so changes to host files are instantly visible inside
the container. It then configures with CMake and runs the tests.
The Docker user is `fishuser` with password `fish`.
The script also supports two arguments `--shell-before` and
`--shell-after`. These drop the user into a bash shell before (or after)
the tests are run, to aid in debugging.
Note there's no automation for invoking this script yet; it must be run
manually. But it runs on both Mac and Linux!
Previously this parameter was used to more-eagerly restore the terminal
mode. This was the basis for #2214. However now we restore the mode
from the reader instead, so we can remove this unused parameter.
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.
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.
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.
Prior to this change, for bindings which have script commands, the
inputter would execute them directly. However an upcoming fix for #7483
will require more integration with the reader. Switch to a new model where
the reader passes in a function to use for executing script commands.
This allows us to write the changelog reasonably simply.
The biggest downside is that pandoc won't be able to handle it anymore
when converting to markdown, but
sphinx-markdown-builder (https://github.com/codejamninja/sphinx-markdown-builder)
should be able to handle it.
This lets littlecheck "diff" the given output with the checks, leading
to easier to understand errors.
E.g. changing some random lines in andandoror.fish yields error output
like:
```
Testing file checks/andandoror.fish ... Failure:
The CHECK on line 36 wants:
if test 4 ok
which failed to match line stdout:9:
if test 3 ok
Context:
[...] from line 17 (stdout:6):
true && false || true: 0
if test 1 ok
if test 2 ok
if test 3 ok <= no check matches this, previous check on line 35
if test 4 ok
0 0 0
1 1 1
2 2 2
3 3 3 <= does not match CHECK '3 5 3' on line 55
4 4 4
0
1
[...] from line 126 (stdout:33):
0
0
0
<= nothing to match CHECK 'banana' on line 135
when running command:
../test/root/bin/fish checks/andandoror.fish
```
This updates littlecheck to b9c24a3.
Use the `-d` parameter to `zfs list` to limit snapshots to the dataset
named in the current token being completed. Thanks to @Debilski for the
tip.
Closes#7472