Bash.Job (Bash v0.3.0)

Copy Markdown View Source

Represents a background job in a Bash session.

Each job has:

  • A job number (1-based, assigned by Session)
  • An OS process ID (from ExCmd)
  • Status tracking (running, stopped, done)

Job States

  • :running - Process is actively executing
  • :stopped - Process has been suspended (SIGSTOP)
  • :done - Process has completed (exit code available)

Output

Job output flows through sinks to the session's OutputCollector, not accumulated in the Job struct itself.

Summary

Types

status()

@type status() :: :running | :stopped | :done

t()

@type t() :: %Bash.Job{
  command: String.t(),
  completed_at: DateTime.t() | nil,
  erlang_pid: pid() | nil,
  exit_code: integer() | nil,
  job_number: pos_integer(),
  os_pid: pos_integer() | nil,
  started_at: DateTime.t(),
  status: status()
}