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
## Summary
- `nssh status` — list active outbound sessions (local) and/or the
current pinned session (remote). Same command, same output shape, works
on either side.
- `nssh status --tail` — pretty-print jsonl events from all active
sessions, multiplexed with `[target] HH:MM:SS event key=value …`
prefixes. Ctrl+C to stop.
- Introduces a lightweight session registry at
`~/.local/state/nssh/sessions/<pid>.json` — written on connect, removed
on exit, GC'd on stale-PID detection.
## Example
```
$ nssh status
active local sessions:
PID TARGET TOPIC UPTIME LOG
83421 devbox nssh_xyz 2h14m ~/.local/state/nssh/nssh.nssh_xyz.jsonl
$ nssh status --tail
following 1 session(s) — Ctrl+C to stop
[devbox] 16:42:01 message-in kind=clip-read-request id=abc
[devbox] 16:42:02 message-in kind=open url=https://…
```
On remote hosts the command projects `~/.local/state/nssh/session` (the
TOML written by the local session-init) into the same shape, so `nssh
status` on the remote shows topic/server/log. The two views aren't
mutually exclusive — a machine that's both a local driver and a remote
target gets both sections.
## Test plan
- [x] `go build ./...`, `go vet ./...`, `go test ./...` all pass
- [x] `nssh status` prints `no active nssh sessions` on a clean machine
- [x] Fake registry entry renders in the table
- [x] Impossible PID (999999) is GC'd on the next `status` call
- [ ] Open a real `nssh <host>` session; confirm it appears in `nssh
status`, disappears on exit
- [ ] `nssh status --tail` prints live events during clipboard/xdg-open
activity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Medium risk because it adds new session lifecycle bookkeeping (pidfile
registry + cleanup) and changes logging/event emission paths used during
active sessions, which could affect observability and session exit
behavior.
>
> **Overview**
> Adds `nssh status [--tail]` to display active local sessions (via a
new `~/.local/state/nssh/sessions/<pid>.json` registry) and the current
remote pinned session (projected from `~/.local/state/nssh/session`),
with `--tail` multiplexing and pretty-printing new JSONL log events.
>
> Unifies wire-message logging across the session and shim by
introducing `logMessage` (`msg-send`/`msg-recv` with
`kind`/`mime`/`id`/`url`/`size`), updates clipboard/open paths to emit
these events, and ensures sessions unregister even when exiting via
`os.Exit`.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
275c972. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
0 commit comments