{"record":{"id":"595eaf684f5b122d","repo":"kovidgoyal/kitty","slug":"no-cmdline-to-run-specified","errorCode":null,"errorMessage":"No cmdline to run specified","messagePattern":"No cmdline to run specified","errorType":"validation","errorClass":"ParsingOfArgsFailed","httpStatus":null,"severity":"error","filePath":"kitty/rc/run.py","lineNumber":113,"sourceCode":"        return pipe()\n\n    def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType:\n        import os\n        import tempfile\n\n        data = payload_get('data')\n        q = self.handle_streamed_data(standard_b64decode(data) if data else b'', payload_get)\n        if isinstance(q, AsyncResponse):\n            return q\n        stdin_data = q.getvalue()\n        from kitty.launch import parse_remote_control_passwords\n\n        cmdline = payload_get('cmdline')\n        allow_remote_control = payload_get('allow_remote_control')\n        pw = payload_get('remote_control_password')\n        rcp = parse_remote_control_passwords(allow_remote_control, pw)\n        if not cmdline:\n            raise ParsingOfArgsFailed('No cmdline to run specified')\n        responder = self.create_async_responder(payload_get, window)\n        stdout, stderr = tempfile.TemporaryFile(), tempfile.TemporaryFile()\n\n        def on_death(exit_status: int, err: Exception | None) -> None:\n            with stdout, stderr:\n                if err:\n                    responder.send_error(f'Failed to run: {cmdline} with err: {err}')\n                else:\n                    exit_code = os.waitstatus_to_exitcode(exit_status)\n                    stdout.seek(0)\n                    stderr.seek(0)\n                    responder.send_data(\n                        {\n                            'stdout': standard_b64encode(stdout.read()).decode('ascii'),\n                            'stderr': standard_b64encode(stderr.read()).decode('ascii'),\n                            'exit_code': exit_code,\n                            'exit_status': exit_status,\n                        }","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/rc/run.py#L95-L131","documentation":"ParsingOfArgsFailed raised by the remote-control 'run' command when the payload contains no cmdline. The run command's sole purpose is to spawn a command line, so an empty cmdline fails argument parsing before anything is executed.","triggerScenarios":"kitten @ run with no command argument, or an RPC payload where the cmdline key is missing/None/empty list.","commonSituations":"Scripts that build the command dynamically and end up with an empty list; quoting bugs that swallow the argument; calling the raw command dict without assembling cmdline.","solutions":["Pass the command and its arguments: kitten @ run --allow-remote-control --env KEY=val -- <cmd> <args...>","In scripts, assert the command list is non-empty before invoking kitten @ run","Check for shell-quoting mistakes that drop the argument (e.g. unquoted empty variables)"],"exampleFix":"# before\nCMD=\"\"; kitten @ run -- $CMD\n# after\nCMD=\"htop\"; [ -n \"$CMD\" ] && kitten @ run -- $CMD","handlingStrategy":"validation","validationCode":"cmdline = [c for c in [\"bash\",\"-lc\", build_cmd()] if c and c.strip()]\nassert cmdline and cmdline[-1].strip(), 'empty cmdline for kitten @ run'","typeGuard":"def is_nonempty_cmdline(v) -> bool:\n    return isinstance(v, list) and len(v) > 0 and all(isinstance(x, str) and x for x in v)","tryCatchPattern":null,"preventionTips":["Set -u / assert non-empty variables before invoking run","Quote expansions; use -- to separate flags from the command"],"tags":["kitty","remote-control","run","missing-argument","cli"],"backgroundTag":"missing-required-parameter","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}