Skip to content

Respect .hidden file #3776

@rgbmew

Description

@rgbmew

yazi --debug output

Yazi
    Version: 26.1.22 (VERGEN_IDEMPOTENT_OUTPUT 2026-02-01)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.93.0 (254b5960 2026-01-19)

Ya
    Version: 26.1.22 (VERGEN_IDEMPOTENT_OUTPUT 2026-02-01)

Config
    Init             : /home/shrimp/.config/yazi/init.lua (394 chars)
    Yazi             : /home/shrimp/.config/yazi/yazi.toml (3433 chars)
    Keymap           : /home/shrimp/.config/yazi/keymap.toml (18890 chars)
    Theme            : /home/shrimp/.config/yazi/theme.toml (4928 chars)
    VFS              : /home/shrimp/.config/yazi/vfs.toml (No such file or directory (os error 2))
    Package          : /home/shrimp/.config/yazi/package.toml (130 chars)
    Dark/light flavor: "" / ""

Emulator
    TERM                : Some("xterm-kitty")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : Some(Kitty)
    Emulator.detect     : Emulator { kind: Left(Kitty), version: "kitty(0.43.1)", light: true, csi_16t: (14, 28), force_16t: false }

Adapter
    Adapter.matches    : Kgp
    Dimension.available: Dimension { rows: 37, columns: 136, width: 1904, height: 1036 }

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

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/bin/bash")
    EDITOR             : Some("/usr/bin/nano")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None
    YAZI_ZOXIDE_OPTS   : None
    FZF_DEFAULT_OPTS   : None
    FZF_DEFAULT_COMMAND: None

Text Opener
    default     : Some(OpenerRule { run: "micro %s", block: true, orphan: false, desc: "Micro", for: None, spread: true })
    block-create: Some(OpenerRule { run: "micro %s", block: true, orphan: false, desc: "Micro", for: None, spread: true })
    block-rename: Some(OpenerRule { run: "micro %s", block: true, orphan: false, desc: "Micro", for: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    tmux build flags   : enable-sixel=Unknown
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file          : 5.46
    ueberzugpp    : No such file or directory (os error 2)
    ffmpeg/ffprobe: 7.1.3 / 7.1.3
    pdftoppm      : 25.07.0
    magick        : 7.1.1-47
    fzf           : 0.67.0
    fd/fdfind     : 10.3.0 / No such file or directory (os error 2)
    rg            : No such file or directory (os error 2)
    chafa         : No such file or directory (os error 2)
    zoxide        : 0.9.8
    7zz/7z        : No such file or directory (os error 2) / 25.01
    resvg         : 0.47.0
    jq            : 1.8.1

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : No such file or directory (os error 2)
    xsel         : No such file or directory (os error 2)

Routine
    `file -bL --mime-type`: text/plain

Please describe the problem you're trying to solve

On most other file managers, if you create a file named .hidden and list names of files/directories you want hidden, the file manager will give those files the hidden flag without renaming them to a dotfile.

For example, if my directory structure looked like this:

directoryname/
    file.txt
    file2.zip
    file3.txt
    otherdirectory/
    .hidden

And my .hidden file contained:

file.txt
otherdirectory

Then file.txt and otherdirectory/ would be invisible unless I enable viewing hidden files, file2.zip and file3.txt stay unhidden.

I'd really love for this functionality to be added to Yazi. I use .hidden files all the time, and it's especially useful for apps that leave random unhidden config directories in my Home folder.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

Ideally, it would work the same in Yazi as it does in most other file managers:

  • Files and directories should both be able to be hidden.
  • The behavior is confined to the directory the .hidden file is located in. (For example, listing file.txt in directoryname/.hidden won't hide files named file.txt in any other directory)
  • Subdirectories of a hidden directory don't inherent the hidden flag. (For example, any files in otherdirectory/ stay unhidden)
  • Filenames are exact. (For example, if I have another file named file.txt2, it remains unhidden)

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions