From a2275012292fceb7aadfc78cc0082a57fc8f68aa Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 21 Jun 2026 19:24:30 +0200 Subject: [PATCH 1/2] ci: fix upload-artifact version (v8 does not exist, use v7) --- .github/workflows/website.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index eb0540480..8043a7a03 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -113,7 +113,7 @@ jobs: echo "uutils WASM build: ${commit_short} (${commit_date})" - name: Upload uutils WASM artifact - uses: actions/upload-artifact@v8 + uses: actions/upload-artifact@v7 with: name: wasm-coreutils path: wasm-out @@ -214,7 +214,7 @@ jobs: echo "${{ matrix.name }} WASM build: ${s} (${d})" - name: Upload ${{ matrix.name }} WASM artifact - uses: actions/upload-artifact@v8 + uses: actions/upload-artifact@v7 with: name: wasm-${{ matrix.name }} path: wasm-out @@ -389,7 +389,7 @@ jobs: run: rm -f public/js/wasm-terminal.test.html - name: Upload artifact for checking the output - uses: actions/upload-artifact@v8 + uses: actions/upload-artifact@v7 with: path: ./public From 6cb56f1c14878031b6456f2f1309b85bc3943384 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 21 Jun 2026 19:36:40 +0200 Subject: [PATCH 2/2] playground: don't path-resolve sed script args resolvePath() normalizes path segments and drops trailing empty components, so a sed script like 's/world/there/' was rewritten to 's/world/there', losing the closing delimiter and producing 'unterminated substitute replacement'. Skip resolvePath for sed's script argument(s) (the first non-option arg, or args after -e/-f). --- static/js/wasm-terminal.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/static/js/wasm-terminal.js b/static/js/wasm-terminal.js index fd5b9afb7..1f79bbeb2 100644 --- a/static/js/wasm-terminal.js +++ b/static/js/wasm-terminal.js @@ -638,10 +638,30 @@ async function executeCommandLine(line) { } try { + // sed's script argument is a program, not a path — it must NOT go through + // resolvePath, which normalizes path segments and would strip a trailing + // delimiter (e.g. `s/world/there/` -> `s/world/there`, breaking the `s` + // command). Collect the indices of any sed script arguments to skip. + const sedScriptIndices = new Set(); + if (cmd === "sed") { + let scriptFromFlag = false; + for (let i = 1; i < args.length; i++) { + const a = args[i]; + if (a === "-e" || a === "-f") { sedScriptIndices.add(i + 1); scriptFromFlag = true; i++; continue; } + if (a.startsWith("-e") || a.startsWith("-f")) { scriptFromFlag = true; } // combined form, e.g. -e's/a/b/' + } + // Without -e/-f, the script is the first non-option argument. + if (!scriptFromFlag) { + for (let i = 1; i < args.length; i++) { + if (!args[i].startsWith("-")) { sedScriptIndices.add(i); break; } + } + } + } // Resolve relative paths using the virtual cwd const resolvedArgs = args.map((arg, i) => { if (i === 0) return arg; // command name if (arg.startsWith("-")) return arg; // flag + if (sedScriptIndices.has(i)) return arg; // sed script, not a path return resolvePath(arg); }); // If the command takes a default path (like ls) and no path args