Skip to content

tailscale: experimental russh + ratatui support#178

Open
npry wants to merge 2 commits into
mainfrom
npry/russh
Open

tailscale: experimental russh + ratatui support#178
npry wants to merge 2 commits into
mainfrom
npry/russh

Conversation

@npry
Copy link
Copy Markdown
Collaborator

@npry npry commented May 12, 2026

Finally got this cleaned up — provide a tailscale::ssh module, which provides integration with russh and ratatui. The levels of indirection are a bit convoluted, but I left a comment on the ssh module explaining the rough organization.

As a quick summary here, there are a few moving pieces: the ssh connection, ssh channels, and the actual tui implementation. The ssh connection is 1:1 with an overlay TCP connection, on which multiple channels may be muxed (this is baseline SSH behavior). Those channels may run an interface built with ratatui, but I leave that optional here (the user can in principle plug in whatever behavior they want).

While russh integrates the connection-level and channel-level operations into a single Handler trait, I break out the per-channel stuff into a ChannelHandler trait, and our top-level russh::Handler is ChannelServer (which takes a ChannelHandler parametrically and automatically spawns ChannelHandlers as channels are opened). Then RatatuiTerm implements ChannelHandler over a parametric RatatuiApp (the user logic to take input and actually draw the interface).

I'm not entirely happy with it — it feels opinionated/frameworky in places rather than elegant/generic, but I also think it captures a bunch of annoying boilerplate in a way that's useful. I feel it's worth merging but also probably not its final form, quite open to critique/suggestions/reworks. Also, my instinct consistent with the granular crates would be to split it out to its own crate, but we said we were gonna do that less — I'm fine wherever we want to put it.

@npry npry force-pushed the npry/russh branch 5 times, most recently from 2a249c5 to 146e1c1 Compare May 12, 2026 06:46
@npry npry marked this pull request as ready for review May 12, 2026 07:27
@npry npry force-pushed the npry/russh branch 2 times, most recently from 5c6e256 to 36768ee Compare May 14, 2026 19:27
npry added 2 commits May 20, 2026 05:35
Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: I464cf0501b290530079a858484d521ae6a6a6964
Provide a happy-path integration with `russh` and `ratatui` that makes
it easier to build in-process SSH TUIs with tailscale-rs.

Signed-off-by: Nathan Perry <nathan@tailscale.com>
Change-Id: I1c49b666d92dcc76076e35585ae4fe7e6a6a6964
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