sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.3k stars 377 forks source link

After configuring opener it removes the default behaviour for other file types which are not defiined in opener #1100

Closed AnkurAlpha closed 5 months ago

AnkurAlpha commented 5 months ago

What system are you running Yazi on?

Linux Wayland

What terminal are you running Yazi in?

foot version: 1.17.2 +pgo +ime +graphemes -assertions

Did you try the latest code to see if this problem got fixed?

Tried, but the problem still

yazi --debug output

```sh Yazi Version: 0.2.5 (Arch Linux 2024-04-27) OS: linux-x86_64 (unix) Debug: false Emulator Emulator.via_env: ("foot", "") Emulator.via_csi: Ok(Foot) Emulator.detect: Foot Adaptor Adaptor.matches: Sixel Desktop XDG_SESSION_TYPE: Some("wayland") WAYLAND_DISPLAY: Some("wayland-1") DISPLAY: Some(":1") SSH shared.in_ssh_connection: false WSL /proc/sys/fs/binfmt_misc/WSLInterop: false Variables SHELL: Some("/usr/bin/fish") EDITOR: Some("/usr/bin/nvim") ZELLIJ_SESSION_NAME: None YAZI_FILE_ONE: None YAZI_CONFIG_HOME: None file(1) Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "file-5.45\nmagic file from /usr/share/file/misc/magic\nseccomp support included\n", stderr: "" }) Text Opener default: None block: None tmux TMUX: false Ueberzug++ Version: Err(Os { code: 2, kind: NotFound, message: "No such file or directory" }) -------------------------------------------------- When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time. You can find it in the "/home/ankur/.local/state/yazi" directory. ```

Describe the bug

I was configuring opener as instructed here : https://yazi-rs.github.io/docs/configuration/yazi/#opener

And I defined some specific apps for some of the files through which it should open but after that the default behaviors for other undefined files were overwritten and now whenever I press "Enter" or "o" while the cursor is hovered on it , nothing happens

Expected Behavior

for other files for which I haven't defined any specific app or thing like the ~/Desktop folder

before using opener it used to open in neovim but after I defined default apps for some specific files then it doesn't do anything , the `~/Desktop' folder just doesn't opens in the neovim

To Reproduce

just paste this to your yazi.toml

[opener]
play = [
    { run = 'mpv "$@"', orphan = true, for = "unix" },
]
view = [
    { run = 'gwenview "$@"', orphan = true, for = "unix" },
]

[open]
# set rules for opening specific files
rules = [
    { name = "*.mpv", use = "play" },        
    { name = "*.png", use = "view" },        
    { name = "*.jpg", use = "view" },        
    { name = "*.jpeg", use = "view" },        

now hover your cursor over something like ~/Desktop folder , now press enter or 'o' it won't open

Now you will only be able to open files with extension :

*.mpv
*.png
*.jpg
*.jpeg

Configuration

[opener]
play = [
    { run = 'mpv "$@"', orphan = true, for = "unix" },
]
view = [
    { run = 'gwenview "$@"', orphan = true, for = "unix" },
]

[open]
# set rules for opening specific files
rules = [
    { name = "*.mpv", use = "play" },        
    { name = "*.png", use = "view" },        
    { name = "*.jpg", use = "view" },        
    { name = "*.jpeg", use = "view" },        

Anything else?

No response

SolitudeSF commented 5 months ago

You need to prepend rules instead of overriding them. https://yazi-rs.github.io/docs/configuration/overview#mixing

sxyazi commented 5 months ago

I've updated the documentation to clarify it in https://github.com/yazi-rs/yazi-rs.github.io/commit/d5d7016006d058657c429c4e56557f38497863a2

github-actions[bot] commented 4 months ago

I'm going to lock this issue because it has been closed for 30 days. ⏳ This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.