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
This was using "/usr/local/bin/fish" for no good reason - 1. fish
might not be installed, 2. fish might not be installed *there*.
Just use /bin/sh in this case, if that doesn't exist we have bigger
problems, and this is just a simple wrapper for a command call.
[ci skip]
In #7459, asan printed error output. However, because we had a failure
on stdout already, littlecheck would only print the first unmatched
line from stderr, leading to output like
```
additional output on stderr:1:
=================================================================
```
Which is of course entirely useless.
So in that case we just let it print *all* unmatched stderr lines, so
you'd get the full asan output, which presumably is of more use.
This upgrades littlecheck to 5f7deafcea4e58dd3d369eae069a3781bb6ce75e.
Instead of using /tmp/fish as a temporary directory for this operation,
which could lead to clobbering user files, use mktemp to create an
actual temporary directory.
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.
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.