upterm session wait
Wait for a session to end
Synopsis
Block until the named session has ended, then exit with its outcome.
Exit status follows the session:
- The command’s own code: the session’s command exited.
- 0: explicit session stop, or –join-timeout elapsed.
- 128+N: the host or command was terminated by signal N.
- 125: canceled, unavailable outcome, or observer failure.
Signal N is the recorded originating signal number (signalNumber in session info JSON), independent of the machine reading the record. Legacy signal records without a valid number are unavailable (125). Parent-context cancellation is recorded as canceled (125); legacy stopped records remain 0. Lookup, read and replacement errors, and cancellation of the waiter’s context, return 125 and retain their diagnostic.
125 is a convention, not a guarantee: a session’s own command can exit 125 too. To tell the two apart, read ‘reason’ from ‘upterm session info NAME -o json’.
A session that has already ended is reported from its record and is not an error. Interrupting this command leaves the session running: it observes and never stops anything.
Wait binds to the launch found when it starts. If a new same-named host is started in the shell background, wait may return the previous launch’s record before the new launch claims the name. Start the detached host synchronously as in the example below, then run ‘upterm session wait NAME’.
upterm session wait NAME [flags]
Examples
# Wait for a detached session and take its exit status:
upterm host --detach --accept --name build -- make
upterm session wait build
Options
-h, --help help for wait
Options inherited from parent commands
--debug enable debug level logging (log file: /home/user/.local/state/upterm/upterm.log).
SEE ALSO
- upterm session - Display and manage terminal sessions