blob: ff60a88134b82e3862a32f3568c6307e8b3def45 (
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
|
# A command pane's command is over when its process exits, not when its pty
# closes. A job it leaves in the background holds the pty open, and the pane
# still says `exit 0` as soon as the command itself is done; a command that
# lets go of its terminal and runs on is not hung up at its pty's end, and
# says how it ended when it does.
file cmds.txt sleep 30 & echo BG''STARTED\nexec </dev/null >/dev/null 2>&1; sleep 1; false
config Verbose off
start 31 120 cmds.txt
wait 8000 cmds.txt
stable 700 20000
snap opened
# line 1: `sleep 30` keeps the pty, and the pane says exit 0 regardless
press middle 7 4
drag middle 34 4
release middle 34 4
wait 10000 exit 0
stable 700 15000
snap background
# line 2, in the same pane now its command is done: its end of file comes at
# once, and its exit a second later, from `false`
press middle 7 5
drag middle 54 5
release middle 54 5
wait 10000 exit 1
stable 700 15000
snap letgo
|