You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+37-3Lines changed: 37 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ output is gone. With `atch` it is on disk until you clear it.
49
49
-**Full session history on disk** — every line ever written is saved and replayed on re-attach
50
50
-**History survives process exit** — re-opening a session shows the complete prior output before starting fresh
51
51
- 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
53
53
- Prevents accidental recursive self-attach
54
54
- Tiny and auditable
55
55
@@ -70,6 +70,24 @@ rm -f atch.tgz
70
70
71
71
Or download the `.tgz` from the releases page and extract it manually.
72
72
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
+
73
91
## Building from source
74
92
75
93
```sh
@@ -100,7 +118,7 @@ If no command is given, `$SHELL` is used.
100
118
|`push <session>`| Copy stdin verbatim to the session. |
101
119
|`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. |
102
120
|`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). |
104
122
|`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. |
105
123
|`current`| Print the current session name and exit 0 if inside a session; exit 1 silently if not. |
106
124
@@ -184,6 +202,11 @@ atch -e '^A' attach work
184
202
atch list
185
203
```
186
204
205
+
**List sessions including those that have exited but still have a log:**
206
+
```sh
207
+
atch list -a
208
+
```
209
+
187
210
**Inspect the last 20 lines of a session log:**
188
211
```sh
189
212
atch tail -n 20 work
@@ -259,7 +282,8 @@ Every byte written to the pty is appended to a log file on disk
259
282
complete history before the live stream begins.
260
283
-**Session exit** — once the program exits, the full output remains on disk.
261
284
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.
263
287
-**Machine reboot** — the log file survives a reboot. The next time you
264
288
open the session you see the complete prior output before the new shell
265
289
starts.
@@ -271,6 +295,16 @@ history only in memory. When the process exits or the machine restarts, the
271
295
output is gone. With `atch` the raw byte stream is on disk until you
272
296
explicitly clear it with `atch clear` (or `atch clear <session>`).
273
297
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
+
274
308
The log is capped at 1 MB by default; once it exceeds that, only the most
275
309
recent 1 MB is kept. You can change the cap per session with `-C`:
0 commit comments