Manage dtach sessions by name. Like a tiny tmux: detachable shells you reach by name, with a liveness-aware list.
dt list sessions (dead = stale socket)
dt work attach to "work", creating it if absent
dt -k work kill session(s) and remove the socket
dt -h help
dt -v version
The positional argument is always a session name, so names never clash with
subcommands — dt ls attaches to a session called ls. Detach with Ctrl-\.
Sockets live in ~/.dtach (override with $DT_DIR). Liveness checks whether a process
still holds the socket (via lsof), so a stale socket left by a crashed master shows as
(dead). (Connecting to probe it would hang: a live dtach socket waits for an attach
client and never closes.)
brew install davidblurton/tap/dtThis pulls in dtach automatically. To install straight from main without waiting on
a tagged release:
brew install --HEAD davidblurton/tap/dtbrew install dtach
curl -fsSL https://raw.githubusercontent.com/davidblurton/dt/main/bin/dt -o /usr/local/bin/dt
chmod +x /usr/local/bin/dtNeeds dtach, plus lsof (ships with macOS). Shell-agnostic — it runs as
an executable, not a shell function, so it works regardless of which shell you use.
Releases are fully automated. Tag and push:
git tag vX.Y.Z
git push origin vX.Y.ZThe release workflow then:
- cuts a GitHub release with generated notes, and
- bumps the formula in
davidblurton/homebrew-tap— computing the tarballsha256and committing the newurl/sha256toFormula/dt.rb.
After that, brew install davidblurton/tap/dt serves the new version. There is no manual
hashing step; never edit the tap formula's sha256 by hand.
Keep bin/dt's VERSION in sync with the tag you push. The Formula/dt.rb in this repo
is only a reference template — the tap repo holds the live formula brew installs.
The tap bump needs a repo secret TAP_GITHUB_TOKEN: a fine-grained PAT scoped to the
homebrew-tap repo with Contents: read and write.
gh secret set TAP_GITHUB_TOKEN --repo davidblurton/dtMIT