{"record":{"id":"b5e37bcf26f3bbd0","repo":"kovidgoyal/kitty","slug":"this-should-be-run-as-kitten-remote-file","errorCode":null,"errorMessage":"This should be run as kitten remote_file","messagePattern":"This should be run as kitten remote_file","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kittens/remote_file/main.py","lineNumber":42,"sourceCode":"default=ask\nWhich mode to operate in.\n\n\n--path -p\nPath to the remote file.\n\n\n--hostname\nHostname of the remote host.\n\n\n--ssh-connection-data\nThe data used to connect over ssh.\n\"\"\"\n\n\ndef main(args: list[str]) -> None:\n    raise SystemExit('This should be run as kitten remote_file')\n\n\n@result_handler()\ndef handle_result(args: list[str], data: str | None, target_window_id: int, boss: BossType) -> None:\n    if data:\n        from kitty.fast_data_types import get_options\n\n        cmd = command_for_open(get_options().open_url_with)\n        open_cmd(cmd, data)\n\n\nif __name__ == '__main__':\n    main(sys.argv)\nelif __name__ == '__doc__':\n    cd = sys.cli_docs  # type: ignore\n    cd['usage'] = ''\n    cd['options'] = option_text\n    cd['help_text'] = 'Ask the user what to do with the remote file. For internal use by kitty, do not run it directly.'","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/remote_file/main.py#L24-L60","documentation":"While materializing the drag source payload on disk, mkdirat() for a directory entry failed with an errno other than EEXIST, and the operation is aborted (abrt) — the whole drag-and-drop source construction fails. This runs on the drag source side in kitty's file-promises/temp tree.","triggerScenarios":"Building a drag payload containing a subdirectory when mkdirat fails with e.g. ENOSPC (disk full), EACCES (permission), EMFILE (fd limit), or EDQUOT on the staging directory.","commonSituations":"Dragging a folder tree from kitty when /tmp (or the configured staging dir) is full or read-only; restrictive sandboxing of kitty itself; fd exhaustion from dragging huge trees.","solutions":["Check free space and write permissions on the staging directory (typically /tmp or XDG_RUNTIME_DIR)","Drag fewer/smaller items to avoid fd/space exhaustion; close other fd-heavy processes","If kitty is sandboxed, grant it write access to the staging area"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Ensure staging area is writable with space before starting a drag\nimport os, shutil\nstaging = os.environ.get('XDG_RUNTIME_DIR', '/tmp')\nif not os.access(staging, os.W_OK) or shutil.disk_usage(staging).free < 50_000_000:\n    abort_drag('staging area not writable or nearly full')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep free space on the staging filesystem (/tmp or XDG_RUNTIME_DIR)","Ensure kitty has write permission to the staging directory","Limit the size of dragged directory trees"],"tags":["drag-and-drop","mkdir","disk-full","kitty"],"backgroundTag":"mkdir-failed","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}