Skip to content

smart-filer.yazi - keep filter active after escape #156

@rsuhada

Description

@rsuhada

yazi --debug output

Yazi
    Version: 25.5.31 (Arch Linux 2025-07-23)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.88.0 (6b00bc38 2025-06-23)

Ya
    Version: 25.5.31 (Arch Linux 2025-07-23)

Emulator
    TERM                : Some("xterm-ghostty")
    TERM_PROGRAM        : Some("ghostty")
    TERM_PROGRAM_VERSION: Some("1.2.3-arch1")
    Brand.from_env      : Some(Ghostty)
    Emulator.detect     : Emulator { kind: Left(Ghostty), light: false, csi_16t: (10, 23), force_16t: false }

Adapter
    Adapter.matches    : Kgp
    Dimension.available: Dimension { rows: 61, columns: 255, width: 2554, height: 1406 }

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

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL           : Some("/usr/bin/zsh")
    EDITOR          : Some("/bin/nano")
    VISUAL          : None
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: Some("\n--height 40%\n--reverse\n--border\n--inline-info\n--cycle\n--filepath-word\n--bind \'alt-i:accept\'\n--bind \'ctrl-m:accept\'\n--bind \'alt-n:backward-kill-word\'\n--bind \'alt-h:backward-kill-word\'\n--bind \'alt-t:kill-word\'\n--bind \'ctrl-h:backward-delete-char\'\n--bind \'ctrl-t:delete-char\'\n--bind \'ctrl-s:toggle-sort\'\n--bind \'ctrl-u:preview-page-up\'\n--bind \'ctrl-v:preview-page-down\'\n--bind \'alt-e:down\'\n--bind \'alt-u:up\'\n--bind \'ctrl-e:down\'\n--bind \'ctrl-u:up\'\n")

Text Opener
    default     : Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for: None, spread: true })
    block-create: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for: None, spread: true })
    block-rename: Some(OpenerRule { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", 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: 8.0 / 8.0
    pdftoppm      : 25.10.0
    magick        : 7.1.2-7
    fzf           : 0.66.0
    fd/fdfind     : 10.3.0 / No such file or directory (os error 2)
    rg            : 15.1.0
    chafa         : 1.16.2
    zoxide        : 0.9.8
    7zz/7z        : No such file or directory (os error 2) / 25.01
    resvg         : 0.45.1
    jq            : 1.8.1

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

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


See https://yazi-rs.github.io/docs/plugins/overview#debugging on how to enable logging or debug runtime errors.

Please describe the problem you're trying to solve

When using smart-filter plugin: yazi-rs/plugins:smart-filter (smart-filter github). When user input dialog is exited via escape the filter is removed (i.e. full unfiltered content of the directory is shown.

It would be good to have the option to keep the filter active:
this is necessary, when there is nothing one can type to correctly select among the options.

Say I typed "data" in dialog and here is my filtered list:

data
data1
data2 | my cursor is here
data3

I want to open data, there is nothing I can type that can get me there.
Since the dialog is open I can't use my movement keys.
If I press enter I open data2 - not what I want.
If I press escape, the filter is deactivated and I'm left to navigate the full unfiltered content.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

escape should close the dialog and leave the directory filtered. Another escape than removes the current filter selection.

Additional context

No response

Checklist

  • I have searched the existing issues/discussions

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions