Add native Windows support (PowerShell port)#1
Open
aclima01 wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Windows support. Herdr's Windows build runs plugin commands with no shell, and a bare
bashresolves to WSL — sobun sync-title.jscan't drive the title sync there. This shipssync-title.ps1, a field-for-field PowerShell port using nativeConvertFrom-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): therefreshaction and the event hooks buildagent: task (workspace)fromherdr pane current,herdr workspace get, and the Claude/Codex session JSONL, then callherdr terminal title set(which works fine on Windows once the server is running).
What changed
sync-title.ps1(new) — mirrorssync-title.js: same title precedence (pane title → agentfallback), the same
(workspace)suffix and 80-char cap, and the same<command-name>/ tagstripping. Uses
Get-ChildItem -Recurse -Filterin place offind, and$env:USERPROFILEfor
HOME.herdr-plugin.toml—platformsnow includeswindows, and every item carries its ownplatforms. The unix entries keepbun sync-title.js(gated tomacos/linux); Windowsentries run
powershell -NoProfile -ExecutionPolicy Bypass -File sync-title.ps1. The manualrefresh action is
refresh-winon Windows, because Herdr rejects duplicate action ids evenacross disjoint platforms (duplicate event
ontriggers are allowed, so each event just getsa second, Windows-gated entry).
refresh-winaction id.Unix behavior is unchanged: those items still run only the original
buncommand.Notes
herdr terminal title setthe unix path uses.Privacy in the README).
🤖 Generated with Claude Code