Skip to content

ya pack commands fail with generic error when $XDG_CONFIG_HOME/yazi does not exist yet #1790

Description

@kmoschcau

What system are you running Yazi on?

Windows WSL

What terminal are you running Yazi in?

wezterm 20240203-110809-5046fc22

yazi --debug output

^[P>|WezTerm 20240203-110809-5046fc22^[\
Yazi
    Version: 0.3.3 (VERGEN_IDEMPOTENT_OUTPUT 2024-09-16)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (VERGEN_IDEMPOTENT_OUTPUT 2024-09-16)

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect : WezTerm

Adapter
    Adapter.matches: Iterm2

Desktop
    XDG_SESSION_TYPE           : None
    WAYLAND_DISPLAY            : Some("wayland-0")
    DISPLAY                    : Some(":0")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: true

Variables
    SHELL              : Some("/usr/bin/fish")
    EDITOR             : Some("nvim")
    VISUAL             : Some("nvim")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : tmux 3.2a
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.41
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: No such file or directory (os error 2)
    magick           : No such file or directory (os error 2)
    fzf              : 0.29
    fd               : 8.3.1
    rg               : 14.1.1
    chafa            :
    zoxide           : 0.9.6
    7z               : No such file or directory (os error 2)
    7zz              : No such file or directory (os error 2)
    jq               : 1.6


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/kmoschcau/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

When running ya pack -a or ya pack -l for example with no existing $XDG_CONFIG_HOME/yazi, one just gets back this error message:

  • Linux: Error: No such file or directory (os error 2)
  • Windows: Error: The system cannot find the path specified. (os error 3)

Once the config directory is present, everything works. I just think it would be nicer for new users to give a more constructive error message or just simply create the directory.

Minimal reproducer

Try to run the above commands without the config directory present.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions