summaryrefslogtreecommitdiff
path: root/test/snapshots/shellset.snap
blob: d2bacf38db19df0c622d152c1d921c3ff0ef50ec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# The Shell builtin names the binary the NEXT terminal execs. What is pinned
# here is the case that has to hold on a machine you did not set up: the name
# resolves to nothing, and the pane opens anyway.
#
# That is not a corner — it is the DEFAULT's failure mode. pardes ships
# `Shell fish` as the default, and a box without fish must still get a working
# shell rather than a pane whose child dies at exec and shows one EOF. So the
# lookup falls back, and this is the proof: a name nothing resolves to, and the
# new pane still greets and lists like any other.
#
# The rest of the feature is unit-tested rather than pinned here, on purpose.
# Which family a binary belongs to, what argv each one gets and where the
# lookup searches are in host_io.Shell's own tests; the fish end of it cannot
# be a golden at all, because fish's prompt carries a hostname and its greeting
# a version number. (Every script in this suite runs bash, pinned through an
# ordinary config file the harness writes — see snapshot.zig.)
file cmd.txt Shell zznosuchshell
file zmarkfile.txt x
start 21 90 cmd.txt
wait 8000 Shell zznosuchshell
stable 700 20000
snap boot
# execute the line the way you would run any command: select it, Tab. Nothing
# on any machine is installed under that name, so the resolver runs out of
# directories. (A file pane, so the line executed is the line you can see —
# typing into a terminal's overlay would leave `gg`/`x` selecting its output.)
key g g
key x
stable 400 5000
key tab
stable 700 15000
# NOTHING happened on screen, and that is the assertion: a name the builtin
# parser does not know is a command line, so it would have forked a terminal
# for this directory and printed `Shell: command not found` into it (that is
# cmdword.snap's contract). One pane, no error — `Shell` was consumed as a
# builtin and its argument went with it.
snap builtin-ran
# a new terminal, which asks for a shell that is not there. It gets the
# fallback: the pane greets, `ls` runs, and its output is on screen. Alt-n and
# Alt-c, because `New`/`Newcol` open an empty +New scratch rather than a shell.
key a-n
key a-c
wait 15000 zmarkfile.txt
stable 700 20000
snap fallback-shell