Skip to content

fix(interceptors): keep shell positionals, a late --, and option values - #115

Open
moise10r wants to merge 2 commits into
mainfrom
fix/15-positional-args-after-c-are-dropped-a-later
Open

moise10r wants to merge 2 commits into
mainfrom
fix/15-positional-args-after-c-are-dropped-a-later

Conversation

@moise10r

@moise10r moise10r commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

What this changes

memnox-shell dropped the words after the -c line and switched to argv mode on a -- that came after -c. It also ran pipefail in -o pipefail -c cmd as if it were a script. The parser now reads arguments left to right. -o, +o, -O, +O, --rcfile and --init-file take their value with them. The new commandShellArgs passes $0, $1 and "$@" to the real shell unchanged.

How it was verified

packages/interceptors/test/shell-line.test.ts has a parser test for each of the three forms in the issue. Another test runs /bin/sh with what commandShellArgs returns and checks the output.

Fixes #15

Checklist

  • pnpm format && pnpm typecheck && pnpm test && pnpm deadcode all pass
  • Behaviour change ships with a test
  • No any, no magic values, no console.* outside cli-output.ts
  • If this touches the decision path: still deterministic — no LLM, network, or randomness
  • If this changes a verb table: the classes that moved are named above (not applicable)
  • If this changes a command, flag or file it writes: docs/ says so (not applicable)

Comment thread packages/interceptors/test/shell-line.test.ts Fixed

This branch has not been deployed

No deployments
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.

memnox-shell: positional args after -c are dropped, a later -- switches mode, and -o pipefail is misparsed

2 participants