{"record":{"id":"25b1bbcefa6f9743","repo":"kovidgoyal/kitty","slug":"the-layout-is-unknown-or-disabled-or-the-name-i","errorCode":null,"errorMessage":"The layout {} is unknown or disabled or the name is ambiguous","messagePattern":"The layout (.+?) is unknown or disabled or the name is ambiguous","errorType":"exception","errorClass":"UnknownLayout","httpStatus":null,"severity":"error","filePath":"kitty/rc/goto_layout.py","lineNumber":52,"sourceCode":"        spec='LAYOUT_NAME',\n        count=1,\n        json_field='layout',\n        completion=RemoteCommand.CompletionSpec.from_string('type:keyword group:\"Layout\" kwds:' + ','.join(layout_names())),\n    )\n\n    def message_to_kitty(self, global_opts: RCOptions, opts: 'CLIOptions', args: ArgsType) -> PayloadType:\n        if len(args) != 1:\n            self.fatal('Exactly one layout must be specified')\n        return {'layout': args[0], 'match': opts.match}\n\n    def response_from_kitty(self, boss: Boss, window: Window | None, payload_get: PayloadGetType) -> ResponseType:\n        tabs = self.tabs_for_match_payload(boss, window, payload_get)\n        for tab in tabs:\n            if tab:\n                try:\n                    tab.goto_layout(payload_get('layout'), raise_exception=True)\n                except ValueError:\n                    raise UnknownLayout('The layout {} is unknown or disabled or the name is ambiguous'.format(payload_get('layout')))\n        return None\n\n\ngoto_layout = GotoLayout()\n","sourceCodeStart":34,"sourceCodeEnd":57,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/rc/goto_layout.py#L34-L57","documentation":"Raised by the @ goto-layout remote-control command when the target tab's goto_layout() rejects the requested layout name — the layout is unknown, disabled at compile/config time, or the name is ambiguous (a prefix matching multiple layouts). Converted from the internal ValueError into an UnknownLayout remote-control error shown to the client.","triggerScenarios":"Calling 'kitten @ goto-layout xyz' with an invalid layout name; using a prefix like 'tall' only when multiple enabled layouts share that prefix; or naming a layout that exists but was disabled via enabled_layouts in kitty.conf.","commonSituations":"Layouts disabled in kitty.conf's enabled_layouts, custom layout names not registered by a loaded kitten, or version differences in the set of builtin layouts.","solutions":["Check enabled layouts: run 'kitten @ goto-layout' candidates from the Layouts group in kitty.conf / docs, and verify enabled_layouts includes the target","Use the exact full layout name (e.g. 'fat', 'grid', 'vertical', 'stack') instead of an ambiguous prefix","For custom layouts, ensure the kitten providing the layout is loaded and the name is registered"],"exampleFix":"# before\nkitten @ goto-layout t\n\n# after\nkitten @ goto-layout tall","handlingStrategy":"validation","validationCode":"from kitty.layout.base import layout_names  # or from config enabled_layouts\nenabled = set(cfg_enabled_layouts)  # e.g. {'fat','grid','horizontal','stack','tall','vertical'}\nname = 'tall'\nmatches = [l for l in enabled if l == name or l.startswith(name)]\nif len(matches) != 1 or matches[0] != name:\n    name = matches[0] if len(matches) == 1 else None\nassert name, f'layout {name!r} unknown or ambiguous among {sorted(enabled)}'","typeGuard":"def is_unambiguous_layout(name: str, enabled: set[str]) -> bool:\n    m = [l for l in enabled if l == name or l.startswith(name)]\n    return len(m) == 1 and m[0] == name","tryCatchPattern":"from kitty.rc.goto_layout import UnknownLayout\ntry:\n    subprocess.run(['kitten', '@', 'goto-layout', name], check=True, capture_output=True, text=True)\nexcept (subprocess.CalledProcessError,) as e:\n    if 'unknown or disabled' in e.stderr:\n        list_and_pick_layout()  # e.g. fall back to 'stack'\n    else:\n        raise","preventionTips":["Mirror enabled_layouts from kitty.conf in scripts and only use names from that set","Use full layout names, never abbreviations, to avoid ambiguity"],"tags":["kitty","remote-control","layout","unknown-name"],"backgroundTag":"invalid-layout-name","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}