Skip to content

Allow usage of opening rules from CLI #2616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 tasks done
ivomac opened this issue Apr 13, 2025 · 1 comment
Open
3 tasks done

Allow usage of opening rules from CLI #2616

ivomac opened this issue Apr 13, 2025 · 1 comment
Labels
feature New feature request

Comments

@ivomac
Copy link

ivomac commented Apr 13, 2025

yazi --debug output

Yazi
    Version: 25.4.8 (d2cc73c 2025-04-13)
    Debug  : false
    Triple : x86_64-unknown-linux-gnu (linux-x86_64)
    Rustc  : 1.86.0 (05f9846f 2025-03-31)

Ya
    Version: 25.4.8 (Arch Linux 2025-04-09)

Emulator
    TERM                : Some("st-256color")
    TERM_PROGRAM        : None
    TERM_PROGRAM_VERSION: None
    Brand.from_env      : None
    Emulator.detect     : Emulator { kind: Left(Foot), light: true, cell_size: Some((11, 20)) }

Adapter
    Adapter.matches    : Sixel
    Dimension.available: WindowSize { rows: 51, columns: 81, width: 891, height: 1020 }

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-1")
    DISPLAY                    : None
    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("nvim")
    VISUAL          : Some("nvim")
    YAZI_FILE_ONE   : None
    YAZI_CONFIG_HOME: None
    YAZI_ZOXIDE_OPTS: None
    FZF_DEFAULT_OPTS: Some("\n\t--height=100%\n\t--info=inline-right\n\t--algo=v2\n\t--tiebreak=begin,length\n\t--tabstop=2\n\t--reverse\n\t--no-mouse\n\t--no-hscroll\n\t--bind=change:top\n\t--bind=\'ctrl-\\:jump\'\n\t--bind=\'ctrl-y:execute-silent(echo {} | wl-copy)\'\n\t\n\t--color=\'fg:-1,fg+:235,bg:-1,bg+:248,hl:3:underline,hl+:11:underline,marker:4,prompt:4\'\n\t--color=\'gutter:-1,info:8,border:3,spinner:1,header:4,pointer:4\'")

Text Opener
    default     : Some(OpenerRule { run: "${EDITOR} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-create: Some(OpenerRule { run: "${EDITOR} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block-rename: Some(OpenerRule { run: "${EDITOR} \"$@\"", 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: 7.1 / 7.1
    pdftoppm      : 25.03.0
    magick        : No such file or directory (os error 2)
    fzf           : 0.60.3
    fd/fdfind     : 10.2.0 / No such file or directory (os error 2)
    rg            : 14.1.1
    chafa         : No such file or directory (os error 2)
    zoxide        : No such file or directory (os error 2)
    7zz/7z        : No such file or directory (os error 2) / 24.09
    jq            : 1.7.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

The file/dir opening rules are very useful. I would be great to be able to use them without having to open yazi, as a sort of xdg-open with terminal capabilities.

Would you be willing to contribute this feature?

  • Yes, I'll give it a shot

Describe the solution you'd like

For example,

yazi --open ~/Readme.md  # opens with editor in terminal
yazi --open ~/ya.mp4     # opens vid player and gives back control to user in terminal

Additional context

No response

Checklist

  • I have searched the existing issues/discussions
  • The latest nightly build doesn't already have this feature
@ivomac ivomac added the feature New feature request label Apr 13, 2025
Copy link

Hey @ivomac, I noticed that you did not correctly follow the issue template. Please ensure that:

  • The requested feature does not exist in the newest nightly build.
  • The debug information (yazi --debug) is updated for the newest nightly.
  • The non-optional items in the checklist are checked.

Issues with needs info will be marked ready once edited with the proper content, or closed after 2 days of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature request
Projects
None yet
Development

No branches or pull requests

1 participant