Repository navigation
feat: attach to the machines a host's Herdr saved - #30
Merged
Merged
Conversation
Herdr's own client switches between Local and the SSH machines saved with herdr machine add, each a server of its own; running herdr --remote inside a pane only shows the other server as that pane's terminal. Bellterm now lists a host's saved machines in the session drawer and attaches to one through the host: a route may carry a relay target, and every remote command then runs as ssh with the bridge's policy on the host, so the host's keys, configuration and known hosts sign in. Unreachable targets report the host's ssh error. Each machine is saved as a node via its host. Refs #29
GlassUiTest.t8 opens the drawer of a host whose Herdr saved a machine, switches to it, checks the machine's own workspace, and switches back. CI runs it on an emulator against the saved-machine job's sshd, after t0 publishes the device key for that host to trust, and keeps the screenshots.
nimrc
marked this pull request as ready for review
November 16, 2026 15:31
nimrc
added a commit
to nimrc/bellterm-ios
that referenced
this pull request
Nov 16, 2026
* feat: attach to the machines a host's Herdr saved Sync native/ and crates/ with Bellterm for Android at nimrc/bellterm#30. The session sidebar lists the host and the SSH machines its Herdr saved with herdr machine add; tapping one attaches to it through the host's own ssh, and the machine is saved as a node via its host. bellterm-ffi exposes list_machines. MachineTests covers routes, storage and parsing, and renders the sidebar with machines. * test: draw the sidebar snapshot in the host app's scene
This was referenced Nov 16, 2026
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.
Fixes #29.
Herdr's own client switches between Local and the SSH machines saved with
herdr machine add. Each machine is a server of its own, which the client reaches over SSH. Runningherdr --remote Binside a pane on A only shows B as that pane's terminal: A's server knows nothing about B, so Bellterm, attached to A, listed only A's workspaces.Bellterm now does what Herdr's client does. The session drawer lists the host and the machines its Herdr saved, and tapping one attaches to that machine's server through the host.
What changed
relay_command(target, command)buildsssh <bridge policy> -- <target> '<command>'for the host's own/bin/sh. That ssh runs withBatchMode,StrictHostKeyChecking=yesand no forwarding, so the host's keys, ssh config, known hosts and Herdr's shared ControlPath sign in to the machine. The phone needs no access to it.Routehas an optionalrelay.Remotewraps every command through it, so the bridge, the Windows fallback, and Install/Update Herdr all reach the machine.exit 0is run through the relay. An unreachable machine then reports the host's ssh error (… could not be reached from its jump host: ssh: connect to host … Connection refused) instead of reading as a host without Herdr.machines::listrunsherdr machine list --jsonwith the first Herdr the bridge would find, keeping enabled machines with valid targets; it is exposed over JNI asNative.listMachines.machine= its SSH target andjumpId= the host. It shows via the host, can't be edited or duplicated, isn't offered as a jump host, and is deleted with its host.Screenshots
Taken by
GlassUiTest.t8_switchesToSavedMachineon an API 35 emulator in CI, against a real sshd with two Herdr sessions.on-b)Tests
relay_commandquoting and validation (/bin/shre-parses it), 267 passed locally.relay.Routes.sshHops, password hops,Machineparsing,NodeJSON withmachine.Saved machine through its host(Ubuntu): starts a local sshd, installs Herdr, and saves the sessionmachinewithherdr machine add ssh://runner@127.0.0.1:2222 --remote-session machine. Then it runs two tests:live_ssh::attaches_to_a_saved_machine_through_its_host: lists the machine over SSH, attaches through the host, round-tripsecho, checks the machine's own workspace, and checks that an unreachable target reports the host's ssh error.GlassUiTest.t0publishes the device key, thent8): drawer, switch, back, and deletion with the host. The job fails if the test was skipped.belltermcrate cannot be built on this Mac (Zig 0.15.2 against the macOS 27 SDK), so native was built and tested in CI only.