Skip to content

Add copy target path command for symlinks #3519

@vmikk

Description

@vmikk

yazi --debug output

Yazi
    Version: 26.1.4 (c9327ca8 2026-01-06)
    Debug  : true
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.92.0 (ded5c06c 2025-12-08)

Ya
    Version: 25.5.31 (b65a880 2025-05-30)

Emulator
    TERM                : Some("xterm-ghostty")
    TERM_PROGRAM        : Some("ghostty")
    TERM_PROGRAM_VERSION: Some("1.2.3-1.fc43")
    Brand.from_env      : Some(Ghostty)
    Emulator.detect     : Emulator { kind: Left(Ghostty), version: "ghostty 1.2.3-1.fc43", light: false, csi_16t: (19, 43), force_16t: false }

Adapter
    Adapter.matches    : Kgp
    Dimension.available: Dimension { rows: 35, columns: 167, width: 3190, height: 1530 }

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    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: false

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

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

Clipboard
    wl-copy/paste: 2.2.1 / 2.2.1
    xclip        : 0.13
    xsel         : 1.2.1

Please describe the problem you're trying to solve

Yazi currently supports copying various file path types (key combinations c + c, c + d, c + f, c + n), but lacks a way to copy the target path of symlinks. Users working with symlinks often need to access the resolved target path, especially when the symlink points to a relative path that becomes unusable when copied literally.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

Add a new copy command c + t that copies the resolved target path of symlinks. For relative targets, resolve them against the symlink's parent directory to produce usable absolute paths. For broken symlinks, still copy the target path (even if it doesn't exist) as this might be useful.

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