Commit 45bb4a9
committed
fix(spec): wait for inner zsh ready and use portable mktemp
Two macOS-specific regressions in the new zpty-based mock:
- `mktemp -p /var/tmp …` is GNU-only. BSD `mktemp` (macOS) treats `-p`
as the prefix flag, so the inner script either pointed at a stale
path or was empty. Build the path explicitly under TMPDIR (or /tmp)
and `:>` it instead, which both shells honor.
- `zpty mock 'zsh -fi -c …'` returns immediately, but ZLE inside the
inner shell isn't ready until later. macOS pty buffering let the
TAB land before `bindkey` had taken effect, so `vared` sat there
forever. Have the inner shell print a `\C-E` sentinel right before
`vared`, and gate `zpty -w` on receiving it. The marker uses a
trailing newline because the inner shell's stdout is line-buffered.
Also pass `-f` alongside `-i` so the inner shell skips user rcfiles
and starts up faster.1 parent 89cf657 commit 45bb4a9
1 file changed
Lines changed: 22 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
12 | 17 | | |
13 | 18 | | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
17 | 22 | | |
18 | 23 | | |
19 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
25 | 33 | | |
26 | 34 | | |
27 | 35 | | |
| 36 | + | |
28 | 37 | | |
29 | 38 | | |
30 | 39 | | |
| |||
41 | 50 | | |
42 | 51 | | |
43 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
47 | 59 | | |
48 | 60 | | |
| 61 | + | |
49 | 62 | | |
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
53 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
54 | 73 | | |
55 | 74 | | |
56 | 75 | | |
| |||
0 commit comments