{"record":{"id":"ae45be17ae843340","repo":"kovidgoyal/kitty","slug":"the-os-window-os-window-id-is-not-a-panel-you-sh","errorCode":null,"errorMessage":"The OS Window {os_window_id} is not a panel you should not use the --action=resize option to resize it","messagePattern":"The OS Window (.+?) is not a panel you should not use the --action=resize option to resize it","errorType":"exception","errorClass":"RemoteControlErrorWithoutTraceback","httpStatus":null,"severity":"error","filePath":"kitty/rc/resize_os_window.py","lineNumber":126,"sourceCode":"            get_os_window_size,\n            layer_shell_config_for_os_window,\n            set_layer_shell_config,\n            toggle_fullscreen,\n            toggle_os_window_visibility,\n        )\n\n        windows = self.windows_for_match_payload(boss, window, payload_get)\n        if windows:\n            ac = payload_get('action')\n            for os_window_id in {w.os_window_id for w in windows if w}:\n                metrics = get_os_window_size(os_window_id)\n                if metrics is None:\n                    raise RemoteControlErrorWithoutTraceback(f'The OS Window {os_window_id} does not exist')\n                panels = payload_get('os_panel')\n                is_panel = metrics['is_layer_shell']\n                if ac == 'os-panel':\n                    if not is_panel:\n                        raise RemoteControlErrorWithoutTraceback(\n                            f'The OS Window {os_window_id} is not a panel you should not use the --action=resize option to resize it'\n                        )\n                    if not panels:\n                        raise RemoteControlErrorWithoutTraceback('Must specify at least one panel setting')\n                    if payload_get('incremental'):\n                        existing = layer_shell_config_for_os_window(os_window_id)\n                        if existing is None:\n                            raise RemoteControlErrorWithoutTraceback(f'The OS Window {os_window_id} has no panel configuration')\n                        from kittens.panel.main import incrementally_update_layer_shell_config\n\n                        try:\n                            lsc = incrementally_update_layer_shell_config(existing, panels)\n                        except Exception as e:\n                            raise RemoteControlErrorWithoutTraceback(str(e))\n                    else:\n                        from kitty.launch import layer_shell_config_from_panel_opts\n\n                        try:","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/rc/resize_os_window.py#L108-L144","documentation":"Raised by kitty's remote control 'resize-os-window --action=os-panel' handler when the targeted OS window is not a layer-shell panel. kitty only permits the os-panel action on windows created as desktop panels (layer-shell surfaces, via kittens.panel), because panel resizing works by updating the layer-shell configuration rather than normal window resizing. The check uses metrics['is_layer_shell'] from the window's backend metrics.","triggerScenarios":"Calling resize-os-window with action=os-panel targeting a normal (non-panel) OS window id, e.g. kitten @ resize-os-window --match id:1 --action=os-panel --os-panel-edge=top on a regular terminal window.","commonSituations":"Scripts that assume any window id can be turned into a panel; using the wrong --match expression so the action lands on the main kitty window instead of the panel window; copying panel commands from docs without first creating the panel via kitten @ launch --type=panel.","solutions":["Verify the target is a panel first: query the window (kitty @ ls / get-window-metrics equivalent) and confirm is_layer_shell is true","Fix the --match expression so it selects the panel window, not the parent kitty window","Create the panel with the panel launch type (kitten @ launch --type=panel ...) before running os-panel actions","If you want to resize a normal window, use --action=resize instead of --action=os-panel"],"exampleFix":"# before\nkitten @ resize-os-window --match id:1 --action=os-panel --os-panel-edge=top\n# after (create/launch a panel, then target it)\nkitten @ launch --type=panel --panel-edge=top --match id:1 some-cmd\nkitten @ resize-os_window --match id:2 --action=os-panel --os-panel-size=40","handlingStrategy":"validation","validationCode":"import subprocess, json\nls = json.loads(subprocess.check_output(['kitten','@','ls']))\nw = next(w for w in ls for t in w['tabs'] for w in t['windows'])\n# confirm panel status before os-panel action\nassert w.get('is_layer_shell') or 'panel' in (w.get('title') or '').lower(), 'not a panel window'","typeGuard":null,"tryCatchPattern":"try:\n    kitten @ resize-os-window --action=os-panel ...\nexcept RCError as e:\n    if 'is not a panel' in str(e): target_regular_window_instead()","preventionTips":["Create panels with launch --type=panel and record their ids","Always pair --match with an explicit, unique window id","Branch panel vs normal window logic in window-management scripts"],"tags":["kitty","remote-control","os-panel","layer-shell","window-matching"],"backgroundTag":"invalid-window-target","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}