Commit c698056
committed
fix(spec): drive fish mock with head -n 1 instead of read+/dev/stdin
fish 3.x's `read` builtin closes stdin after the first line when run
from a `-c` script with a piped stdin (fish-shell/fish-shell#5714).
The previous `read -l LINE < /dev/stdin` worked around it on Linux but
on macOS BSD `/dev/stdin` opens via /dev/fd/0, which EOFs on the second
iteration and silently killed the loop — every fish case after the
first failed with a broken pipe (and an empty exception message).
Replace the `read` loop with `head -n 1` per iteration. The simulator
is strictly synchronous (one line in, one response out), so `head`'s
read-ahead never eats data the next iteration would need.1 parent 5b51c6e commit c698056
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
0 commit comments