Skip to content

gterm: add per-connection Herdr auto-attach with tests - #42

Merged
madeye merged 1 commit into
mainfrom
fix/herdr-auto-attach-tests
Sep 7, 2026
Merged

madeye merged 1 commit into
mainfrom
fix/herdr-auto-attach-tests

Conversation

@madeye

@madeye madeye commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds an Attach with Herdr toggle to saved connections. When on, the PTY channel execs herdr via the remote login shell (exec "$SHELL" -ilc 'exec herdr') instead of requesting a plain shell, so ~/.local/bin / ~/.cargo/bin are on PATH.
  • Taps on the terminal surface are delivered as mouse left click so Herdr's tabs, panes and menus respond; pinch maps to Herdr pane zoom; the accessory bar gains Herdr prefix shortcuts; foreground resume bumps the window size so Herdr repaints.
  • PTYChannelHandler sequences PTY → exec requests, reports request rejections / write failures / nonzero exits as errors exactly once, and treats a clean detach as a normal close.
  • Persistence: SavedConnection.attachHerdr with legacy payloads defaulting to off.

Tests

  • HerdrSupportTests (option mapping, codec round-trip, gesture/shortcut wiring) in the iOS gtermTests scheme.
  • HerdrAutoAttachTests drive the channel handler with NIOEmbedded; the new macOS gtermSSHTests target additionally execs the startup command against fixture shell profiles and a fixture herdr binary (PATH from login profile / interactive rc, command-not-found exit, clean detach, I/O passthrough).

Verification

  • xcodebuild -scheme gtermSSHTests -destination 'platform=macOS' test — 10/10 passed
  • xcodebuild -scheme gtermTests -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 16' test — all suites passed
  • xcodebuild -scheme gterm -sdk iphonesimulator CODE_SIGNING_ALLOWED=NO build — succeeded

https://claude.ai/code/session_01DZZu4krm76hCsDfspY6rBE

Add an "Attach with Herdr" toggle to saved connections. When enabled the
PTY channel execs herdr through the remote login shell instead of
requesting a plain shell, taps on the surface are delivered as mouse
clicks so Herdr's tabs, panes and menus respond, pinch maps to pane zoom,
the accessory bar gains Herdr prefix shortcuts, and foreground resume
bumps the window size so Herdr repaints.

PTYChannelHandler now sequences PTY -> exec requests, reports request
rejections and nonzero exits as errors exactly once, and treats a clean
detach as a normal close.

Tests: HerdrSupportTests (option mapping, persistence codec, gesture and
shortcut wiring) run in gtermTests; HerdrAutoAttachTests drive the
channel with NIOEmbedded and, in the new macOS gtermSSHTests target,
exec the startup command against fixture shell profiles.

Claude-Session: https://claude.ai/code/session_01DZZu4krm76hCsDfspY6rBE
@madeye
madeye merged commit 31aa17e into main Sep 7, 2026
1 check passed
@madeye
madeye deleted the fix/herdr-auto-attach-tests branch September 7, 2026 02:59
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