Skip to content

Infrawrench/detachproc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

detachproc

Run a command on a detached PTY and reattach later — like screen/tmux, but as a fully transparent byte proxy. detachproc never parses or rewrites the terminal stream, so SGR mouse reporting, bracketed paste, keyboard protocols, and every other escape sequence pass through untouched. Built for hosting interactive coding agents (Claude Code, Codex) on remote VMs.

  • One client at a time. A new attach steals the session from the previous client (like screen -D -r). The old client is told why and exits cleanly.
  • Survives disconnects. The daemon holds the PTY; the child never sees the client come and go (apart from a redraw-triggering SIGWINCH).
  • Replay on attach. The last 256 KB of output is replayed so the screen isn't blank, then a resize forces the app to redraw properly.
  • Exit propagation. When the child exits while a client is attached, the client exits with the same status.

Usage

detachproc run --session my-agent -- claude --dangerously-skip-permissions
# ... disconnect, come back later ...
detachproc run --session my-agent -- claude   # reattaches, command ignored
detachproc attach my-agent                    # reattach only (errors if absent)
detachproc list                               # live sessions
detachproc kill my-agent                      # SIGTERM the child

Sessions live under ~/.detachproc/<name>.sock (override with $DETACHPROC_DIR). Daemon logs go to ~/.detachproc/<name>.log.

Install

Static Linux binaries are published on GitHub releases:

curl -fsSL "https://github.com/Infrawrench/detachproc/releases/latest/download/detachproc-$(uname -m)-unknown-linux-musl" \
  -o ~/.local/bin/detachproc && chmod +x ~/.local/bin/detachproc

Or build from source with cargo build --release.

About

Transparent detached-PTY session holder — screen/tmux without the escape-sequence mangling

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages