summaryrefslogtreecommitdiff
path: root/test/snapshots/shellset.snap
blob: 7d213a84f814c456ef28e505679658d3eaa8f0ec (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, so Shell refuses it and says why on the message row,
# and the next pane opens anyway with the shell that was set before.
#
# A default $SHELL that names nothing executable falls back to /bin/sh
# (config.defaultShell), and the host's lookup still falls back at spawn for
# a shell that went away after it was set: a pane never gets a child that
# dies at exec and shows one EOF.
#
# 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