Repository navigation
feat(terminal): run remote sessions in browser WebAssembly - #2144
Conversation
| extractErr = fmt.Errorf("non-local source path %q", h.Name) | ||
| break | ||
| } | ||
| path := filepath.Join(dir, filepath.FromSlash(h.Name)) |
| if !filepath.IsLocal(filepath.Join(filepath.Dir(h.Name), h.Linkname)) { | ||
| extractErr = fmt.Errorf("non-local source link %q", h.Linkname) | ||
| } else { | ||
| extractErr = os.Symlink(h.Linkname, path) |
|
Reviewed. Checked that every guest export has an explicit argument schema, that struct marshalling goes through the guest manifest plus Rebased onto main, which merged #2147 (OSC 133 prompts, Kitty images) and #2138 (the
vet passes for linux, darwin, windows and js/wasm; under js/wasm (Node) the vt suite (including both browser ABI tests) and the base/terminal suite pass, |
bd20224 to
02cd2f2
Compare
02cd2f2 to
1cfb39d
Compare
A browser terminal can now consume a remote
Options.Connthrough NSGo’s existing view and input path. The package embeds the pinned libghostty-vt as browser-native WebAssembly, marshals its separate 32-bit memory using validated ABI metadata, and installs typed callbacks for terminal effects, PNG decoding and secure entropy. Local-program requests return the existing remote-session guidance.The generator reproduces the full-feature freestanding module from an isolated copy of the pinned source, with two scoped graphics/file-media adjustments and linked license notices. Browser apps need no Zig installation, native library or runtime download. English/Chinese public terminal guides and the agent reference describe the app-owned WebSocket byte-stream and resize contracts; HarmonyOS and mini-program hosts remain documented gaps.
Validation on macmini:
go tool nsgo check -target all,harmonyos,miniprogram_wechat,miniprogram_qq,miniprogram_alipay,miniprogram_douyin -jobs 2passed.TestTerminalBrowserSessionpassed against a real native PTY over a real WebSocket: actual DOM input, executed command output, ANSI pixels, alternate-screen restoration and close. Captured screenshots were inspected.c8c95f1183f2416d18b37e50a1e7c1a9a0aeea0122f72a5e7c2c6e2e623dcc1d.go tool nsgo build -target web examples/gallerypassed. The web release’s third-party notices include Ghostty, Zig and Wuffs.Closes #1455.