{"record":{"id":"74e3f7f2c883c4bd","repo":"kovidgoyal/kitty","slug":"too-few-arguments-to-pipe-function","errorCode":null,"errorMessage":"Too few arguments to pipe function","messagePattern":"Too few arguments to pipe function","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"kitty/options/utils.py","lineNumber":333,"sourceCode":"@func_with_args('move_window')\ndef move_window(func: str, rest: str) -> FuncArgsType:\n    rest = rest.lower()\n    rest = {'up': 'top', 'down': 'bottom'}.get(rest, rest)\n    prest: int | str = rest\n    try:\n        prest = int(prest)\n    except Exception:\n        if prest not in ('left', 'right', 'top', 'bottom'):\n            log_error(f'Invalid move_window specification: {rest}')\n            prest = 0\n    return func, [prest]\n\n\n@func_with_args('pipe')\ndef pipe(func: str, rest: str) -> FuncArgsType:\n    r = list(shlex_split(rest))\n    if len(r) < 3:\n        log_error('Too few arguments to pipe function')\n        r = ['none', 'none', 'true']\n    return func, r\n\n\n@func_with_args('set_colors')\ndef set_colors(func: str, rest: str) -> FuncArgsType:\n    r = list(shlex_split(rest))\n    if len(r) < 1:\n        log_error('Too few arguments to set_colors function')\n    return func, r\n\n\n@func_with_args('remote_control')\ndef remote_control(func: str, rest: str) -> FuncArgsType:\n    func, args = shlex_parse(func, rest)\n    if len(args) < 1:\n        log_error('Too few arguments to remote_control function')\n    return func, args","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/options/utils.py#L315-L351","documentation":"The pipe action requires at least three shell-split arguments (name, command type/window filter, and the command); with fewer, kitty substitutes the no-op ['none','none','true'].","triggerScenarios":"`map f1 pipe some-command` — shlex_split(rest) yields fewer than 3 items.","commonSituations":"Misremembering pipe's syntax (it needs a name, a filter like 'text'/'screen'/'ansi' plus the command) or unbalanced quotes causing shlex to produce fewer tokens.","solutions":["Use full syntax: pipe <name> <text|screen|ansi|...> <command...>, e.g. `map f1 pipe selected text pbcopy`","Check quoting: the command portion with spaces must be one shell-quoted token list that splits to >= 3 fields"],"exampleFix":"# before\nmap f1 pipe pbcopy\n# after\nmap f1 pipe selected text pbcopy","handlingStrategy":"validation","validationCode":"import shlex\nok = len(shlex.split('selected text pbcopy')) >= 3","typeGuard":null,"tryCatchPattern":null,"preventionTips":["pipe needs name + filter + command (3+ tokens)","Quote multi-word commands so shlex yields all parts"],"tags":["kitty","config","pipe","parser"],"backgroundTag":"invalid-config-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}