Skip to content

Add Mosh support for terminal connections#2

Open
danielaustralia1 wants to merge 1 commit into
dodo-reach:mainfrom
danielaustralia1:feature/mosh-terminal
Open

Add Mosh support for terminal connections#2
danielaustralia1 wants to merge 1 commit into
dodo-reach:mainfrom
danielaustralia1:feature/mosh-terminal

Conversation

@danielaustralia1

Copy link
Copy Markdown

Summary

  • Adds opt-in Mosh support for the terminal tab, keeping it alive through network changes, IP roaming, and sleep/wake
  • All other features (files, sessions, skills, discovery) continue to use SSH — Mosh is terminal-only
  • Toggle lives in the connection editor under a new Terminal panel; shows a Homebrew install hint if mosh isn't found on the Mac
  • Connections without Mosh enabled behave exactly as before

Use case

Connecting to a home PC running inference from a laptop that moves between networks. SSH terminal sessions drop on every network change; Mosh reconnects transparently.

Changes

File Change
Models/ConnectionProfile.swift prefersMosh: Bool = false — optional, backward-compatible JSON decode
Utilities/MoshSupport.swift New — detects mosh binary at Homebrew paths and via which
Services/SSH/SSHTransport.swift moshArguments(for:) — builds mosh [--ssh=ssh -p N] user@host
Services/Terminal/TerminalSession.swift Selects executable + args at init based on prefersMosh and availability
Services/Terminal/TerminalViewHost.swift Uses session.executablePath / session.terminalArguments instead of hardcoded /usr/bin/ssh
Views/Connections/ConnectionEditorSheet.swift Terminal panel with Mosh toggle; disabled with install hint when mosh not found

Requirements

  • mosh must be installed on the Mac (brew install mosh)
  • mosh-server must be installed on the remote host (apt install mosh / brew install mosh)
  • SSH key auth must already work (Mosh uses SSH to bootstrap)

🤖 Generated with Claude Code

Mosh keeps the terminal tab alive through network changes, IP roaming,
and sleep/wake — useful when connecting to a home inference machine
from a laptop on the go. All other app features (files, sessions,
skills, discovery) continue to use SSH as before.

- ConnectionProfile gains prefersMosh: Bool (default false, backward-compatible)
- MoshSupport utility detects mosh binary at common Homebrew paths and via `which`
- SSHTransport.moshArguments() builds mosh invocation, routing custom port via --ssh flag
- TerminalSession selects executable and arguments at init based on prefersMosh and mosh availability
- TerminalViewHost uses session.executablePath and session.terminalArguments instead of hardcoded /usr/bin/ssh
- ConnectionEditorSheet gains a Terminal panel with a Mosh toggle; shows a Homebrew install hint when mosh is not found

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dodo-reach

Copy link
Copy Markdown
Owner

I’m going to hold off on merging it for now, mostly for product-direction reasons rather than because the idea is bad. Hermes Desktop is intentionally built around a single direct SSH connection model, and I want to be careful about adding a second transport story just for the terminal while everything else remains SSH-based.

That keeps the app simpler to reason about, document, and support.

So I’d like to leave this open while I think more about whether Mosh belongs in the product at all.

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.

2 participants