A modern terminal with a built-in multiplexer: close it and your sessions keep running. Run shells and tons of AI agents across your machines, then pick them up from desktop, browser, TUI and more. Written in Rust with no UI framework: interface drawn straight on the GPU. No Electron, GPUI or webview.
Rust agentagent-orchestrationaiai-agentsclaude-codecodexcoding-agentlinuxmacosmultiplayermultiplexerrustterminalterminal-emulatorterminal-multiplexertmuxtuiweztermwindows
ci(web): pin wasm-opt and check that the wasm bundle can start
RoversXd76d363ca3ca
diff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex 41d598fc..ecdcb519 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -207,11 +207,13 @@ jobs:# exactly (ci/build-web.sh refuses any other), so its version is read# from Cargo.toml rather than written here twice. The prebuilt binary# takes seconds where `cargo install` takes minutes. binaryen is- # wasm-opt, which takes a quarter off the wasm.+ # wasm-opt, which takes a quarter off the wasm. It is pinned to an+ # upstream release rather than taken from apt: Ubuntu 24.04's binaryen+ # 108 points the __wbindgen_externrefs export at the fixed-size funcref+ # table, and the page then fails to start.## Retried, because this job gates all three packaging jobs: a GitHub- # release 502 or an apt mirror hiccup would otherwise take the whole- # release with it.+ # release 502 would otherwise take the whole release with it.- name: Install wasm-bindgen and wasm-optrun: |set -euo pipefail@@ -220,8 +222,10 @@ jobs:bash ci/retry.sh bash -c "curl -sSfL \'https://github.com/rustwasm/wasm-bindgen/releases/download/${version}/${dir}.tar.gz' \| tar -xz -C \"\$HOME/.cargo/bin\" --strip-components=1 '${dir}/wasm-bindgen'"- bash ci/retry.sh sudo apt-get update- bash ci/retry.sh sudo apt-get install -y --no-install-recommends binaryen+ binaryen=version_133+ bash ci/retry.sh bash -c "curl -sSfL \+ 'https://github.com/WebAssembly/binaryen/releases/download/${binaryen}/binaryen-${binaryen}-x86_64-linux.tar.gz' \+ | tar -xz -C \"\$HOME/.cargo/bin\" --strip-components=2 'binaryen-${binaryen}/bin/wasm-opt'"wasm-bindgen --versionwasm-opt --versiondiff --git a/ci/build-web.sh b/ci/build-web.shindex 2468764b..4ed5c85d 100755--- a/ci/build-web.sh+++ b/ci/build-web.sh@@ -30,6 +30,7 @@ wasm-bindgen --target web --out-dir "$OUT/pkg" "$WASM"if command -v wasm-opt >/dev/null 2>&1 && [ "$PROFILE" = release ]; thenwasm-opt -Oz -o "$OUT/pkg/thinkterm_web_bg.wasm" "$OUT/pkg/thinkterm_web_bg.wasm"fi+node ci/check-web-wasm.mjs "$OUT/pkg/thinkterm_web_bg.wasm"# The colour-scheme table the picker fetches. Compiled into the binary, so# this is a build step and not a file in the tree.cargo build -p wezterm --bin thinkterm $CARGO_FLAGSdiff --git a/ci/check-web-wasm.mjs b/ci/check-web-wasm.mjsnew file mode 100644index 00000000..2e20c458--- /dev/null+++ b/ci/check-web-wasm.mjs@@ -0,0 +1,27 @@+// Fails when the wasm-bindgen glue cannot start the bundle's wasm.+// Usage: node ci/check-web-wasm.mjs path/to/thinkterm_web_bg.wasm+//+// The glue grows the table exported as __wbindgen_externrefs and stores JS+// values in it. An old wasm-opt (binaryen 108) re-points that export at the+// fixed-size funcref table, and the page then stays blank in every browser.+import { readFileSync } from 'node:fs';++const path = process.argv[2];+const module = new WebAssembly.Module(readFileSync(path));+const imports = {};+for (const { module: name, name: field } of WebAssembly.Module.imports(module)) {+ (imports[name] ??= {})[field] = () => {+ throw new Error(`unexpected call to ${field} while checking`);+ };+}+const table = new WebAssembly.Instance(module, imports).exports.__wbindgen_externrefs;+if (!(table instanceof WebAssembly.Table)) {+ console.error(`${path}: no __wbindgen_externrefs table export`);+ process.exit(1);+}+try {+ table.set(table.grow(4), true);+} catch (e) {+ console.error(`${path}: __wbindgen_externrefs is not a growable externref table: ${e.message}`);+ process.exit(1);+}