suspend

Synopsis

job|process |> suspend

Description

Suspends the whole process tree of every input job: SIGSTOP to the process group on Linux and macOS, suspension of the threads of the job object on Windows. The job state becomes suspended. Time spent suspended is not counted against the time limit of the job and is reported in suspended_total of the final record.

Only running jobs can be suspended. Job and process records are handled by this implementation.

Parameters

The command has no parameters.

Input and output

Form Input Output
default job, process effect

Input job or process records. Produces one effect record per input record; its job field holds the job record after the change.

Effect

Property Value
Category run
Effect external
Reversibility irreversible
Implementation builtin

Examples

Suspend job j7.

jobs "j7" |> suspend
suspended  job:j7

Suspend all running jobs.

jobs state: running |> suspend

Suspend job j3 and read its state.

jobs "j3" |> suspend |> select job.state

Errors

Code Meaning Typical fix
E_JOB_STATE The job is not running, for example already suspended. Resume it: jobs "j7" |> resume.
E_UNKNOWN_JOB No job has the identifier. Use one of the identifiers in candidates.

resume, stop, jobs.

Source file on GitHub: docs/commands/suspend.md