Jobs at the prompt
In the terminalela --spec jobs-at-the-prompt
A job started at the prompt belongs to the session, so the prompt comes back at once and the
job runs on while other lines are typed (LANGUAGE.md, Who waits). A job
started in a proc or a with block is still that code's, which waits for it.
ela> x = run make testela> git status...run: x ✓ make test 2:15 — wait $x to see its outputela> wait $x
- When a job has ended, a line says so before the next prompt: the variable holding it,
✓, or✗and its exit code, the command or the call, and the time it ran. A job held in a list or a map gets its number instead; its output stays held until it is waited for. - A job no variable holds can never be waited for, so its output follows its line.
- A job's output is held until
wait, which prints it whole;$x.outputreads it once the job has ended. - Ctrl-C while
waitwaits ends the wait, not the job, and returns to the prompt. exit, or Ctrl-D, with jobs still running or stopped says how many,2 jobs running; exit again to stop them,1 job stopped; exit again to end it, or2 jobs running and 1 stopped; exit again to end them, and stays. A secondexitstraight after sends them TERM, and a stopped one CONT after it so it ends, then KILL to those still there 3 seconds later, and leaves; any other line in between asks again at the next.catch runworks in scripts only.