Upterm

Instant Terminal Sharing

View project on GitHub

upterm attach

Attach this terminal to a running session

Synopsis

Attach this terminal to a running session, given its name or session ID.

NAME|ID is the session’s name (the one ‘upterm host’ printed, or –name gave it) or its session ID; ‘upterm session list’ shows both. Without one, the only running session is attached to; with several, give one.

The session keeps running when this terminal detaches, and any number of terminals can attach to it over time. Everything but the keys below is sent to the session as typed, and a SIGTERM or SIGHUP detaches.

Keys, at the start of a line (–escape-char changes the ~, or turns them off): ~. detach: the session keeps running; ‘upterm attach NAME’ reattaches and ‘upterm session stop NAME’ ends it ~? show the session’s status and keys, in this terminal only; the program may need its own redraw afterwards ~^Z suspend this terminal (Unix); fg resumes it ~~ send a ~

Through an outer ssh connection, ssh’s own ~ escapes come first: type ~~., ~~? and ~~^Z, or connect with ‘ssh -e none’ and type them plain.

On Unix you can also suspend with ~^Z, run ‘upterm session info NAME’, and return with fg. A session that keeps producing output while this terminal is suspended may disconnect it (254 below); ‘upterm attach NAME’ brings it back.

Exit status: 0 after a detach; the session’s status once it ends (0 when no guest joined within its join timeout; 1 when it was stopped or ended by a signal); 254 if this terminal was disconnected; 255 if it could not attach, including a usage or configuration error.

upterm attach [NAME|ID] [flags]

Examples

  # Attach to the session named build-shell:
  upterm attach build-shell

  # Attach to a session by its session ID:
  upterm attach d3k5fia7m4us73ehblug

  # Attach with no escape character, so every keystroke reaches the session:
  upterm attach build-shell --escape-char none

Options

      --escape-char string   The character that starts upterm's keys at the start of a line, or 'none' to turn them off. (default "~")
  -h, --help                 help for attach
      --hide-client-ip       Hide guests' IP addresses from upterm's output. When it isn't set (by flag, environment or config file), they are hidden in CI only; --hide-client-ip=false shows them there too.

Options inherited from parent commands

      --debug   Enable debug logging (log file: /home/user/.local/state/upterm/upterm.log). A non-empty DEBUG turns it on too.

SEE ALSO

  • upterm - Instant Terminal Sharing
Auto generated by spf13/cobra on 18-Oct-2026