{"record":{"id":"0b5390111b885ec2","repo":"kovidgoyal/kitty","slug":"unknown-type-of-input-type-of-input","errorCode":null,"errorMessage":"Unknown type_of_input: {type_of_input}","messagePattern":"Unknown type_of_input: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"kitty/boss.py","lineNumber":2532,"sourceCode":"            if input_data is None:\n                type_of_input = end_kitten.type_of_input\n                q = type_of_input.split('-') if type_of_input else []\n                if not q:\n                    data: bytes | None = None\n                elif q[0] in ('text', 'history', 'ansi', 'screen'):\n                    data = w.as_text(as_ansi='ansi' in q, add_history='history' in q, add_wrap_markers='screen' in q).encode('utf-8')\n                elif type_of_input == 'selection':\n                    sel = self.data_for_at(which='@selection', window=w)\n                    data = sel.encode('utf-8') if sel else None\n                elif q[0] in ('output', 'first_output', 'last_visited_output'):\n                    which = {\n                        'output': CommandOutput.last_run,\n                        'first_output': CommandOutput.first_on_screen,\n                        'last_visited_output': CommandOutput.last_visited,\n                    }[q[0]]\n                    data = w.cmd_output(which, as_ansi='ansi' in q, add_wrap_markers='screen' in q).encode('utf-8')\n                else:\n                    raise ValueError(f'Unknown type_of_input: {type_of_input}')\n            else:\n                data = input_data if isinstance(input_data, bytes) else input_data.encode('utf-8')\n            copts = common_opts_as_dict(get_options())\n            env = {\n                'KITTY_COMMON_OPTS': json.dumps(copts),\n                'KITTY_CHILD_PID': str(w.child.pid),\n                'OVERLAID_WINDOW_LINES': str(w.screen.lines),\n                'OVERLAID_WINDOW_COLS': str(w.screen.columns),\n            }\n            if is_wrapped:\n                cmd = [kitten_exe(), kitten]\n                env['KITTEN_RUNNING_AS_UI'] = '1'\n                env['KITTY_CONFIG_DIRECTORY'] = config_dir\n                if w is not None:\n                    env['KITTY_BASIC_COLORS'] = json.dumps(w.screen.color_profile.basic_colors())\n            else:\n                cmd = [kitty_exe(), '+runpy', 'from kittens.runner import main; main()']\n                env['PYTHONWARNINGS'] = 'ignore'","sourceCodeStart":2514,"sourceCodeEnd":2550,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/boss.py#L2514-L2550","documentation":"In Boss's launcher/pipe machinery, an unknown type_of_input value in a launch/pipe specification raises ValueError. Only specific input sources (e.g. 'selection', 'output' variants) are recognized when the command requests input from the window.","triggerScenarios":"A launch/remote-control command specifying an unrecognized type_of_input for the child's stdin, e.g. `kitty @ launch --type-of-input=foo` or a map action using an input type kitty does not know.","commonSituations":"Typos in type_of_input, or using an input type introduced in a newer kitty version on an older kitty binary.","solutions":["Correct the spelling of type_of_input (check kitty @ launch --help)","Upgrade kitty to the version that supports the desired input type","Remove the option if no window input is needed"],"exampleFix":"# before\nkitty @ launch --type-of-input=buf\n# after\nkitty @ launch --type-of-input=output","handlingStrategy":"validation","validationCode":"VALID_INPUT_TYPES = {'none','selection','clipboard','primary','output','first_output','last_visited_output'}\nif type_of_input not in VALID_INPUT_TYPES:\n    raise ValueError(f'bad type_of_input: {type_of_input}')","typeGuard":"def is_valid_type_of_input(v: str) -> bool:\n    return v in {'none','selection','clipboard','primary','output','first_output','last_visited_output'}","tryCatchPattern":"try:\n    launch(...)\nexcept ValueError as e:\n    if 'Unknown type_of_input' in str(e):\n        fix_and_retry()\n    else:\n        raise","preventionTips":["Enumerate allowed input types in your wrapper","Check kitty @ launch --help for the running version's supported values"],"tags":["kitty","launch","remote-control","validation"],"backgroundTag":"invalid-enum-value","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}