Skip to content

Commit 825e142

Browse files
committed
Document list -a for exited sessions
List -a now displays inactive sessions that still have a log file on disk, enabling users to view output from terminated sessions.
1 parent 941dbb8 commit 825e142

1 file changed

Lines changed: 37 additions & 3 deletions

File tree

‎README.md‎

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ output is gone. With `atch` it is on disk until you clear it.
4949
- **Full session history on disk** — every line ever written is saved and replayed on re-attach
5050
- **History survives process exit** — re-opening a session shows the complete prior output before starting fresh
5151
- Push stdin directly to a running session
52-
- List all sessions with liveness status
52+
- List sessions with liveness status; `list -a` also shows exited sessions that still have a log on disk
5353
- Prevents accidental recursive self-attach
5454
- Tiny and auditable
5555

@@ -70,6 +70,24 @@ rm -f atch.tgz
7070

7171
Or download the `.tgz` from the releases page and extract it manually.
7272

73+
## Why C and a static binary?
74+
75+
`atch` sits between your keyboard and your running program at the lowest
76+
level of the Unix process model: it opens pseudo-terminals, manages Unix
77+
domain sockets, and forwards raw byte streams. These are system-level
78+
operations that map directly to C system calls. There is no meaningful
79+
runtime overhead to hide, no framework to bring in, and no interpreter to
80+
start — the binary does exactly what it advertises and nothing else.
81+
82+
The release binaries are statically linked against
83+
[musl libc](https://musl.libc.org/). A static musl binary is a
84+
**single self-contained file** that carries everything it needs. You copy
85+
it to any Linux machine — Ubuntu, Debian, Alpine, RHEL, a bare container
86+
image, a two-year-old distro — and it runs. There are no shared library
87+
version mismatches, no `apt install`, no `LD_LIBRARY_PATH` gymnastics. For
88+
a small tool you want to drop onto servers and forget about, a static binary
89+
is the right default.
90+
7391
## Building from source
7492

7593
```sh
@@ -100,7 +118,7 @@ If no command is given, `$SHELL` is used.
100118
| `push <session>` | Copy stdin verbatim to the session. |
101119
| `kill [-f] <session>` | Gracefully stop a session (SIGTERM, then SIGKILL after 5 s if needed). With `-f` / `--force`, skip the grace period and send SIGKILL immediately. |
102120
| `clear [<session>]` | Truncate the on-disk session log. Defaults to the current session when run inside one. |
103-
| `tail [-f] [-n N] <session>` | Print the last N lines of the session log (default: 10). With `-f`, follow new output as it is written. |
121+
| `tail [-f] [-n N] <session>` | Print the last N lines of the session log (default: 10). Works for both running and exited sessions. With `-f`, follow new output as it is written (useful for monitoring a running session without attaching). |
104122
| `list [-a]` | List sessions. Shows `[attached]` when a client is connected, `[stale]` for leftover sockets with no running master. With `-a`, also shows `[exited]` sessions that have a log file but are no longer running. Prints `(no sessions)` when the list is empty. |
105123
| `current` | Print the current session name and exit 0 if inside a session; exit 1 silently if not. |
106124

@@ -184,6 +202,11 @@ atch -e '^A' attach work
184202
atch list
185203
```
186204

205+
**List sessions including those that have exited but still have a log:**
206+
```sh
207+
atch list -a
208+
```
209+
187210
**Inspect the last 20 lines of a session log:**
188211
```sh
189212
atch tail -n 20 work
@@ -259,7 +282,8 @@ Every byte written to the pty is appended to a log file on disk
259282
complete history before the live stream begins.
260283
- **Session exit** — once the program exits, the full output remains on disk.
261284
Running `atch mysession` again starts a fresh session but first shows
262-
everything from the previous one, so you know exactly what it did.
285+
everything from the previous one, so you know exactly what it did. Use
286+
`atch list -a` to see all sessions that still have a log, including exited ones.
263287
- **Machine reboot** — the log file survives a reboot. The next time you
264288
open the session you see the complete prior output before the new shell
265289
starts.
@@ -271,6 +295,16 @@ history only in memory. When the process exits or the machine restarts, the
271295
output is gone. With `atch` the raw byte stream is on disk until you
272296
explicitly clear it with `atch clear` (or `atch clear <session>`).
273297

298+
To inspect the log without attaching to the session, use `atch tail`:
299+
300+
```sh
301+
atch tail mysession # last 10 lines
302+
atch tail -n 50 mysession # last 50 lines
303+
atch tail -f mysession # follow live output
304+
```
305+
306+
This works whether the session is running, exited, or from a previous boot.
307+
274308
The log is capped at 1 MB by default; once it exceeds that, only the most
275309
recent 1 MB is kept. You can change the cap per session with `-C`:
276310

0 commit comments

Comments
 (0)