Bundled mosh-client
This directory holds the network-protocol-only mosh-client binary
bundled with the Netcatty installer. Netcatty drives the ssh +
mosh-server bootstrap itself and then launches this bundled client
directly (see electron/bridges/moshHandshake.cjs and
electron/bridges/terminalBridge.cjs).
How binaries land here
-
.github/workflows/build-mosh-binaries.ymlbuilds or fetchesmosh-clienton relevant pushes/PRs, or on a manualworkflow_dispatch. It usesscripts/build-mosh/build-linux.shandscripts/build-mosh/build-macos.shfor Linux/macOS, andscripts/build-mosh/fetch-windows.shfor the pinned Windows bundle:target provenance linux-x64upstream source, manylinux2014, static third-party deps + glibc linux-arm64upstream source, manylinux2014, static third-party deps + glibc darwin-universalupstream source, lipo arm64 + x86_64, macOS system dylibs only win32-x64Netcatty-pinned runtime bundle + FluentTerminal fallback win32-arm64(not built — Cygwin arm64 port not yet stable) The upstream Cygwin Windows build is not rebuilt in this workflow by default. Windows releases use a SHA256-pinned bundle that was built by Netcatty and verified for packaging.
-
When manually dispatched with
release_tag, that workflow publishes the binaries to the dedicatedbinaricat/Netcatty-mosh-binrepository. The release gets a tag likemosh-bin-1.4.0-1, withSHA256SUMSattached. -
Release packaging runs
scripts/resolve-mosh-bin-release.cjsbeforenpm run fetch:mosh. It uses an explicit workflow input first, then theMOSH_BIN_RELEASErepository variable, then the latest non-draftmosh-bin-*GitHub Release from the dedicated binary repository. The fetch step pulls the binaries intoresources/mosh/<platform-arch>/. For local packaging, setMOSH_BIN_RELEASEyourself before running the same fetch command. OverrideMOSH_BIN_OWNER/MOSH_BIN_REPOonly when testing a different binary repository.electron-builder.config.cjsthen copies the matching binary intoResources/mosh/mosh-client[.exe].Local dev uses the same binary path:
npm run devrunsnpm run fetch:mosh:devfirst, which downloads the host platform's bundledmosh-clientinto this gitignored directory. Netcatty does not fall back to a system-installedmoshormosh-client; if the bundled binary is missing, Mosh startup fails loudly instead of using whatever happens to be installed on the developer machine.Official Windows package builds currently ship x64 only for bundled Mosh coverage. Windows arm64 packaging should be added only after we have a tested arm64 client bundle.
The directory is otherwise empty (binaries are gitignored).
Licenses
- Mosh itself is licensed under GPL-3.0 (https://github.com/mobile-shell/mosh).
- Netcatty is GPL-3.0, so redistribution as part of the installer is permitted.
- The default Windows x64 artifact is a SHA256-pinned Netcatty
mosh-client-win32-x64.tar.gzbundle frombinaricat/Netcatty-mosh-binreleasemosh-bin-1.4.0-2. It includesmosh-client.exe, required Cygwin runtime DLLs, and the bundledxterm-256colorterminfo entry. The FluentTerminal standalonemosh-client.exefrom https://github.com/felixse/FluentTerminal @ commitbad0f85remains published as a pinned fallback. - Bundled/static deps (OpenSSL Apache-2.0, protobuf BSD-3-Clause, ncurses MIT) are compatible with GPL-3.0.
Reproducible build
To reproduce the binaries locally:
docker run --rm -v $PWD:/workspace -w /workspace \
-e MOSH_REF=mosh-1.4.0 -e ARCH=x64 -e OUT_DIR=/workspace/out \
quay.io/pypa/manylinux2014_x86_64 \
bash scripts/build-mosh/build-linux.sh
For macOS the build needs an Xcode toolchain; see
scripts/build-mosh/build-macos.sh.
Phase 2/3 — done in this PR
electron/bridges/moshHandshake.cjsreimplements the upstream Mosh Perl wrapper in Node: parser + sniffer + command builders as pure functions.terminalBridge.startMoshSessionruns the SSH bootstrap in a node-pty so password / 2FA / known-hosts prompts render naturally in the user's terminal, then swapssession.procfrom the ssh PTY to a freshly-spawnedmosh-clientPTY whenMOSH CONNECTis detected. Keystrokes that arrive after the swap go to mosh-client becausewriteToSessionreadssession.proclazily.- Mosh startup requires Netcatty's bundled
mosh-clientand a usablesshclient for the remote bootstrap. System-installedmosh/mosh-clientbinaries are intentionally ignored. - Windows x64 currently ships the pinned Netcatty runtime bundle. The old standalone client remains only as a release fallback.
Roadmap
- Add Windows arm64 only after a tested arm64 client bundle is available.
- Make
MOSH_REFtrack upstream release tags automatically.