Yeachan-Heo/oh-my-codex · error

tmux pane mode does not accept an additional command. ${SPAR

Error message

tmux pane mode does not accept an additional command.
${SPARKSHELL_USAGE}

What it means

tmux-pane mode accepts only the --tmux-pane and --tail-lines flags. The parser encountered an unrecognized positional token while scanning and rejects it, since sparkshell would otherwise run it as a command inside tmux mode, which is unsupported.

Source

Thrown at src/cli/sparkshell.ts:364

      const parsed = Number.parseInt(next, 10);
      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {
        throw new Error(`--tail-lines must be an integer between 100 and 1000.\n${SPARKSHELL_USAGE}`);
      }
      tailLines = parsed;
      sawTailLines = true;
      index += 1;
      continue;
    }
    if (token.startsWith('--tail-lines=')) {
      const parsed = Number.parseInt(token.slice('--tail-lines='.length), 10);
      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {
        throw new Error(`--tail-lines must be an integer between 100 and 1000.\n${SPARKSHELL_USAGE}`);
      }
      tailLines = parsed;
      sawTailLines = true;
      continue;
    }
    throw new Error(`tmux pane mode does not accept an additional command.\n${SPARKSHELL_USAGE}`);
  }

  if (!paneId) throw new Error(`--tmux-pane requires a pane id.\n${SPARKSHELL_USAGE}`);
  if (!paneId.trim()) throw new Error(`--tmux-pane requires a pane id.\n${SPARKSHELL_USAGE}`);

  return {
    kind: 'tmux-pane',
    argv: ['tmux', ...buildCapturePaneArgv(paneId, sawTailLines ? tailLines : 200)],
  };
}

function runSparkShellFallback(args: readonly string[], options: RunSparkShellFallbackOptions = {}): void {
  const { announce = true, cause = 'native sidecar unavailable', nativePath = 'native-resolution', state = 'unavailable' } = options;
  const invocation = parseSparkShellFallbackInvocation(args);
  if (announce) {
    process.stderr.write(`[sparkshell] native sidecar unavailable; cause=${sanitizeFallbackDiagnostic(cause)}; path=${sanitizeFallbackDiagnostic(nativePath)}; state=${sanitizeFallbackDiagnostic(state)}; remediation=install a compatible native sidecar, reconnect for hydration, or set ${OMX_SPARKSHELL_BIN_ENV}. Falling back to raw command execution without summary support.\n`);
  }
  const result = spawnSync(invocation.argv[0], invocation.argv.slice(1), {

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Remove the trailing command; pane mode only captures output: `sparkshell --tmux-pane 0`
  2. If you wanted to run a command, drop --tmux-pane and pass the command normally

Example fix

# before
sparkshell --tmux-pane 0 psql
# after
sparkshell --tmux-pane 0
Defensive patterns

Strategy: validation

Validate before calling

const extra = args.filter(a => !a.startsWith('--tmux-pane') && !a.startsWith('--tail-lines'));
if (mode === 'tmux' && extra.length > 0) throw new Error('tmux pane mode takes no command argument');

Prevention

When it happens

Trigger: `sparkshell --tmux-pane 0 bash` or `sparkshell --tmux-pane 0 my-script.sh`.

Common situations: Copy-pasting a normal sparkshell command and adding --tmux-pane, expecting the pane contents to be fed to a command; misunderstanding that pane mode only captures pane output.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/703bb5bed6d85931. Report an issue: GitHub.