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

  1. Check free space and write permissions on the staging directory (typically /tmp or XDG_RUNTIME_DIR)
  2. Drag fewer/smaller items to avoid fd/space exhaustion; close other fd-heavy processes
  3. 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

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


AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27). Data as JSON: /api/errors/b5e37bcf26f3bbd0. Report an issue: GitHub.