Skip to content

Feature to restore selection #3140

@maxfl

Description

@maxfl

yazi --debug output

Yazi
    Version: 25.6.11 (da97e5a8 2025-07-30)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.88.0 (6b00bc38 2025-06-23)

Ya
    Version: 25.6.11 (da97e5a8 2025-07-30)

Emulator
    TERM                : Some("xterm-256color")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : Some(Konsole)
    Emulator.detect     : Emulator { kind: Left(Konsole), light: true, csi_16t: (8, 17), force_16t: false }

Adapter
    Adapter.matches    : KgpOld
    Dimension.available: Dimension { rows: 32, columns: 215, width: 1722, height: 548 }

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

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

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

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       : tmux 3.5a
    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    : 2.9.7
    ffmpeg/ffprobe: 7.1.1 / 7.1.1
    pdftoppm      : 25.07.0
    magick        : 7.1.2-0
    fzf           : 0.65.0
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : 1.16.1
    zoxide        : 0.9.8
    7zz/7z        : No such file or directory (os error 2) / 24.09
    resvg         : No such file or directory (os error 2)
    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


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

This might be useful for the following operation, for example:

  1. select files (symlinks)
  2. yank files
  3. paste targets with paste --follow
  4. restore selection
  5. remove symlinks

Step 5. requires the same set of files to be selected. It would be useful to have a key for it, similar to gv in vim.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

toggle_restore or toggle --restore command which selects the files which were previously selected.

Additionally toggle_yanked may be provided to select exactly the files which are currently yanked.

Additional context

I was not able to find this proposal in issues, in !51 and in currently available functions.

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