{"record":{"id":"703bb5bed6d85931","repo":"Yeachan-Heo/oh-my-codex","slug":"tmux-pane-mode-does-not-accept-an-additional-comma","errorCode":null,"errorMessage":"tmux pane mode does not accept an additional command.\n${SPARKSHELL_USAGE}","messagePattern":"tmux pane mode does not accept an additional command\\.\n(.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/sparkshell.ts","lineNumber":364,"sourceCode":"      const parsed = Number.parseInt(next, 10);\n      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {\n        throw new Error(`--tail-lines must be an integer between 100 and 1000.\\n${SPARKSHELL_USAGE}`);\n      }\n      tailLines = parsed;\n      sawTailLines = true;\n      index += 1;\n      continue;\n    }\n    if (token.startsWith('--tail-lines=')) {\n      const parsed = Number.parseInt(token.slice('--tail-lines='.length), 10);\n      if (!Number.isFinite(parsed) || parsed < 100 || parsed > 1000) {\n        throw new Error(`--tail-lines must be an integer between 100 and 1000.\\n${SPARKSHELL_USAGE}`);\n      }\n      tailLines = parsed;\n      sawTailLines = true;\n      continue;\n    }\n    throw new Error(`tmux pane mode does not accept an additional command.\\n${SPARKSHELL_USAGE}`);\n  }\n\n  if (!paneId) throw new Error(`--tmux-pane requires a pane id.\\n${SPARKSHELL_USAGE}`);\n  if (!paneId.trim()) throw new Error(`--tmux-pane requires a pane id.\\n${SPARKSHELL_USAGE}`);\n\n  return {\n    kind: 'tmux-pane',\n    argv: ['tmux', ...buildCapturePaneArgv(paneId, sawTailLines ? tailLines : 200)],\n  };\n}\n\nfunction runSparkShellFallback(args: readonly string[], options: RunSparkShellFallbackOptions = {}): void {\n  const { announce = true, cause = 'native sidecar unavailable', nativePath = 'native-resolution', state = 'unavailable' } = options;\n  const invocation = parseSparkShellFallbackInvocation(args);\n  if (announce) {\n    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`);\n  }\n  const result = spawnSync(invocation.argv[0], invocation.argv.slice(1), {","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/sparkshell.ts#L346-L382","documentation":"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.","triggerScenarios":"`sparkshell --tmux-pane 0 bash` or `sparkshell --tmux-pane 0 my-script.sh`.","commonSituations":"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.","solutions":["Remove the trailing command; pane mode only captures output: `sparkshell --tmux-pane 0`","If you wanted to run a command, drop --tmux-pane and pass the command normally"],"exampleFix":"# before\nsparkshell --tmux-pane 0 psql\n# after\nsparkshell --tmux-pane 0","handlingStrategy":"validation","validationCode":"const extra = args.filter(a => !a.startsWith('--tmux-pane') && !a.startsWith('--tail-lines'));\nif (mode === 'tmux' && extra.length > 0) throw new Error('tmux pane mode takes no command argument');","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat --tmux-pane mode as capture-only; don't append commands","Keep a separate code path for command-wrapping invocations"],"tags":["cli","tmux","argument-validation"],"backgroundTag":"unexpected-cli-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}