Skip to content

Add native Windows support (PowerShell port)#1

Open
aclima01 wants to merge 1 commit into
rjyo:mainfrom
aclima01:windows-support
Open

Add native Windows support (PowerShell port)#1
aclima01 wants to merge 1 commit into
rjyo:mainfrom
aclima01:windows-support

Conversation

@aclima01

Copy link
Copy Markdown

Summary

Adds Windows support. Herdr's Windows build runs plugin commands with no shell, and a bare
bash resolves to WSL — so bun sync-title.js can't drive the title sync there. This ships
sync-title.ps1, a field-for-field PowerShell port using native ConvertFrom-Json (no Bun/Node),
and routes each manifest item per-OS via platforms.

Validated end-to-end on Herdr 0.7.1-preview / Windows 11 (Windows Terminal + PowerShell): the
refresh action and the event hooks build agent: task (workspace) from herdr pane current,
herdr workspace get, and the Claude/Codex session JSONL, then call herdr terminal title set
(which works fine on Windows once the server is running).

What changed

  • sync-title.ps1 (new) — mirrors sync-title.js: same title precedence (pane title → agent
    • custom status → latest user prompt from the session JSONL → agent name → numbered-tab
      fallback), the same (workspace) suffix and 80-char cap, and the same <command-name> / tag
      stripping. Uses Get-ChildItem -Recurse -Filter in place of find, and $env:USERPROFILE
      for HOME.
  • herdr-plugin.tomlplatforms now includes windows, and every item carries its own
    platforms. The unix entries keep bun sync-title.js (gated to macos/linux); Windows
    entries run powershell -NoProfile -ExecutionPolicy Bypass -File sync-title.ps1. The manual
    refresh action is refresh-win on Windows, because Herdr rejects duplicate action ids even
    across disjoint platforms (duplicate event on triggers are allowed, so each event just gets
    a second, Windows-gated entry).
  • README — Windows in Requirements and the refresh-win action id.

Unix behavior is unchanged: those items still run only the original bun command.

Notes

  • Windows is Herdr's own "preview / best effort" tier for plugins; this rides on the same
    herdr terminal title set the unix path uses.
  • One caveat inherited from the design: the title can include prompt text (already covered under
    Privacy in the README).

🤖 Generated with Claude Code

Herdr runs no shell on Windows and its `bash` resolves to WSL, so
`bun sync-title.js` can't drive the title sync there. This adds
sync-title.ps1 — a field-for-field PowerShell port of sync-title.js using
native ConvertFrom-Json (no Bun/Node) and `herdr terminal title set` — and
routes each manifest item per-OS via `platforms`:

- unix items gated to macos/linux (unchanged `bun` command)
- Windows items run `powershell -File sync-title.ps1`
- the manual refresh action is `refresh-win` on Windows (Herdr rejects
  duplicate action ids even across disjoint platforms; duplicate event `on`
  triggers are allowed, so each event just gets a second Windows-gated entry)

Tested end-to-end on Herdr 0.7.1-preview / Windows 11: the refresh action
and events build `agent: task (workspace)` from `herdr pane current`,
`workspace get`, and the Claude/Codex session JSONL, then set the Windows
Terminal title.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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