{"record":{"id":"dacfa4eea021c2e9","repo":"kovidgoyal/kitty","slug":"failed-to-start-tab-drag-e","errorCode":null,"errorMessage":"Failed to start tab drag: {e}","messagePattern":"Failed to start tab drag: (.+?)","errorType":"console","errorClass":"OSError","httpStatus":null,"severity":"warning","filePath":"kitty/tabs.py","lineNumber":1921,"sourceCode":"                title = re.sub(r'[\\n\\r]', ' ', title)\n                title = replace_c0_codes_except_nl_space_tab(title.encode()).decode()\n                opts = get_options()\n                if td.is_active:\n                    fg = color_as_int(opts.active_tab_foreground)\n                    bg = color_as_int(opts.active_tab_background)\n                else:\n                    fg = color_as_int(opts.inactive_tab_foreground)\n                    bg = color_as_int(opts.inactive_tab_background)\n                title_pixels, width = draw_single_line_of_text(self.os_window_id, title, 0xFF000000 | fg, 0xFF000000 | bg, width)\n                title_height = len(title_pixels) // (width * 4)\n                thumbnails = ((title_pixels, width, title_height), (title_pixels + pixels, width, title_height + height))\n                drag_data = {\n                    f'application/net.kovidgoyal.kitty-tab-{os.getpid()}': str(tab.id).encode(),\n                }\n                try:\n                    start_drag_with_data(self.os_window_id, drag_data, thumbnails)\n                except OSError as e:\n                    log_error(f'Failed to start tab drag: {e}')\n                    set_tab_being_dragged()\n                    self.mark_tab_bar_dirty()  # re-render the tab bar in case it was drawn without the dragged tab\n                break\n        else:\n            set_tab_being_dragged()\n\n    def handle_tab_bar_mouse(self, x: float, y: float, button: int, modifiers: int, action: int) -> None:\n        if button == -1:  # motion\n            dragged_tab_id, drag_started, start_x, start_y = get_tab_being_dragged()\n            if dragged_tab_id and self.tab_for_id(dragged_tab_id) is not None and not drag_started:\n                threshold = get_options().drag_threshold\n                if threshold and math.sqrt((x - start_x) ** 2 + (y - start_y) ** 2) > threshold:\n                    set_tab_being_dragged(dragged_tab_id, True, start_x, start_y)\n                    get_boss().request_thumbnail(self.os_window_id, get_boss().start_tab_drag)\n                    self.recent_tab_bar_mouse_events.clear()\n            return\n\n        tab_id_at_pointer = self.tab_bar.tab_id_at(int(x), int(y))","sourceCodeStart":1903,"sourceCodeEnd":1939,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/tabs.py#L1903-L1939","documentation":"Starting a native drag-and-drop for a tab (dragging a tab out of the window) failed with an OSError from the platform backend; kitty resets the dragged-tab state so the UI stays consistent.","triggerScenarios":"start_drag_with_data(os_window_id, drag_data, thumbnails) raises OSError during the tab drag handler in tabs.py.","commonSituations":"Platform/windowing limitations (some Wayland compositors restrict XDnD/mime-based drags), running under a compositor that doesn't support the drag mime type, or driver quirks.","solutions":["Drag within the window instead of dragging out to another kitty instance (copy/move via :cmd or remote control)","Update kitty and your compositor — Wayland drag support has improved over releases","File an issue with kitty including your OS/compositor and the OSError text"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["If your compositor lacks drag support, use :detach-window or kitten remote control instead of dragging tabs out","Keep kitty and compospositor updated; note your platform when reporting"],"tags":["kitty","drag-and-drop","tab-management","wayland"],"backgroundTag":"drag-and-drop-unsupported","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}