Skip to content

Fish does not create XDG_RUNTIME_DIR if missing #7335

@a-m-s

Description

@a-m-s

The functions env_get_runtime_path and check_runtime_path look like they are intended to create $XDG_RUNTIME_DIR, if it is defined but doesn't exist, but actually fail to do so. The code only uses XDG_RUNTIME_DIR if the directory already exists, and already has the correct access mode. It then silently falls back to the /tmp/fish.$USER that I was trying to avoid.

The problem is that
a) env_get_runtime_path checks access before calling check_runtime_path; this prevents the directory being created. It is also redundant because check_runtime_path will check access anyway.
b) there's no warning or explanation why it's ignoring the user configured directory.

(I discovered this because fish from LinuxBrew appears to be incapable of obtaining my username from QAS on an ancient Ubuntu 14.04 system, meaning that the fallback method doesn't work either. I don't expect this to be a common problem for others. It took a fair amount of searching and code inspection to figure out how to work around the problem.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething that's not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions