kovidgoyal/kitty · error · SystemExit
This should be run as kitten remote_file
Error message
This should be run as kitten remote_file
What it means
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.
Source
Thrown at kittens/remote_file/main.py:42
default=ask
Which mode to operate in.
--path -p
Path to the remote file.
--hostname
Hostname of the remote host.
--ssh-connection-data
The data used to connect over ssh.
"""
def main(args: list[str]) -> None:
raise SystemExit('This should be run as kitten remote_file')
@result_handler()
def handle_result(args: list[str], data: str | None, target_window_id: int, boss: BossType) -> None:
if data:
from kitty.fast_data_types import get_options
cmd = command_for_open(get_options().open_url_with)
open_cmd(cmd, data)
if __name__ == '__main__':
main(sys.argv)
elif __name__ == '__doc__':
cd = sys.cli_docs # type: ignore
cd['usage'] = ''
cd['options'] = option_text
cd['help_text'] = 'Ask the user what to do with the remote file. For internal use by kitty, do not run it directly.'View on GitHub (pinned to 6d5d0c4406)
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
Defensive patterns
Strategy: validation
Validate before calling
# Ensure staging area is writable with space before starting a drag
import os, shutil
staging = os.environ.get('XDG_RUNTIME_DIR', '/tmp')
if not os.access(staging, os.W_OK) or shutil.disk_usage(staging).free < 50_000_000:
abort_drag('staging area not writable or nearly full') Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- This should be run as kitten resize-window
- This kitten should be run as: kitten quick-access-terminal
- Failed to create a temporary from STDIN pipe with error: %w
- Failed to copy data from STDIN pipe to temp file with error:
- terminal responded with drag source error: %s
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/b5e37bcf26f3bbd0.
Report an issue: GitHub.