Skip to content

feat: live statusline via shepherd watch - #11

Merged
jwarykowski merged 3 commits into
masterfrom
feat/watch-statusline
Jul 30, 2026
Merged

feat: live statusline via shepherd watch#11
jwarykowski merged 3 commits into
masterfrom
feat/watch-statusline

Conversation

@jwarykowski

@jwarykowski jwarykowski commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Opt-in config.watch = true streams shepherd watch (NDJSON, board-scoped) and refreshes the statusline counts on every board change — from the TUI or another process — instead of only on FocusGained.

  • Re-scopes the stream when you switch boards.
  • Stops on VimLeavePre.
  • Default false (no background process unless asked).

@jwarykowski
jwarykowski force-pushed the feat/project-and-global-view branch from cc97697 to d65d97a Compare July 24, 2026 11:38
@jwarykowski
jwarykowski force-pushed the feat/watch-statusline branch from 87aad30 to e7b6183 Compare July 24, 2026 11:41
Base automatically changed from feat/project-and-global-view to master July 24, 2026 12:05
Opt-in config.watch streams `shepherd watch` (NDJSON, board-scoped) and
refreshes counts on every change, so TUI/external edits update the statusline
without waiting for FocusGained. Re-scopes on board switch; stops on VimLeavePre.
@jwarykowski
jwarykowski force-pushed the feat/watch-statusline branch from e7b6183 to fcabefb Compare July 24, 2026 12:30
The on_exit closure cleared the shared watch_job unconditionally. A restart
kills the old job, starts the new one, and the old job's exit callback then
lands and nils out the *new* handle — so a second board switch never restarted
the stream (the statusline kept watching the previous board and served a stale
count), and VimLeavePre saw no handle to kill, orphaning `shepherd watch` on
every exit.

Compare identities before clearing, and report a nonzero exit of the current
job — an older shepherd without the `watch` verb used to fail silently.
Live counts are what a statusline is for; opt-in meant most installs sat on
FocusGained-only refreshes without knowing there was anything better.

Gated on `vim.fn.executable`, because on by default a missing binary would
otherwise throw ENOENT out of setup() on every startup instead of staying a
`:checkhealth` problem.
@jwarykowski
jwarykowski merged commit 5a88d53 into master Jul 30, 2026
3 checks passed
@jwarykowski
jwarykowski deleted the feat/watch-statusline branch July 30, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant