Skip to content
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

Plugins like zoxide don't seem to work #1494

Closed
moshpirit opened this issue Aug 15, 2024 · 6 comments
Closed

Plugins like zoxide don't seem to work #1494

moshpirit opened this issue Aug 15, 2024 · 6 comments
Labels
invalid This doesn't seem right

Comments

@moshpirit
Copy link

moshpirit commented Aug 15, 2024

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

kitty 0.35.2

yazi --debug output

Yazi
    Version: 0.3.0 (Arch Linux 2024-08-07)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.0

Emulator
    Emulator.via_env: ("xterm-256color", "")
    Emulator.via_csi: Ok(Kitty)
    Emulator.detect : Kitty

Adapter
    Adapter.matches: Kitty

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

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL              : Some("/bin/bash")
    EDITOR             : Some("nvim -u ~/.config/nvim-chad/init.lua")
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None
    ZELLIJ_SESSION_NAME: None

Text Opener
    default: Some(Opener { run: "$EDITOR \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "$EDITOR \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

tmux
    TMUX   : false
    Version: 3.4

Dependencies
    file             : 5.45
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: 2.2.2
    magick           : 7.1.1-36
    fzf              : 0.54.3
    fd               : 10.1.0
    rg               : 14.1.0
    chafa            : 1.14.2
    zoxide           : 0.9.4
    7z               : 17.05
    7zz              : No such file or directory (os error 2)
    jq               : 1.7.1


--------------------------------------------------
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/alberto/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

No, and I'll explain why below

Describe the bug

When using yazi, I press z or Z and nothing happens; no message, no anything, if I press any other key, yazi seems to respond as it should to that. I also tried to manually download the plugins from github and preload them, but it doesn't seem to work either.

Minimal reproducer

  • Install arch
  • Install yazi
  • Install and use zoxide for a couple of days
  • When using yazi, press z and any other key

Anything else?

The plugins that I downloaded from here and manually added to the preload in yazi.toml are lua files in their own "*.yazi" folder (eg: "~/.config/yazi/plugins/zoxide.yazi/zoxide.lua") :
imagen

  plugins
├──   archive.yazi
│   └──   archive.lua
├──   code.yazi
│   └──   code.lua
├──   dds.yazi
│   └──   dds.lua
├──   empty.yazi
│   └──   empty.lua
├──   extract.yazi
│   └──   extract.lua
├──   file.yazi
│   └──   file.lua
├──   folder.yazi
│   └──   folder.lua
├──   font.yazi
│   └──   font.lua
├──   fzf.yazi
│   └──   fzf.lua
├──   image.yazi
│   └──   image.lua
├──   json.yazi
│   └──   json.lua
├──   magick.yazi
│   └──   magick.lua
├──   mime.yazi
│   └──   mime.lua
├──   noop.yazi
│   └──   noop.lua
├──   pdf.yazi
│   └──   pdf.lua
├──   plugins-del-github-de-yazi
│   ├──   yazi-plugin
│   │   ├──   preset
│   │   │   ├──   plugins
│   │   │   │   ├──   archive.lua
│   │   │   │   ├──   code.lua
│   │   │   │   ├──   dds.lua
│   │   │   │   ├──   empty.lua
│   │   │   │   ├──   extract.lua
│   │   │   │   ├──   file.lua
│   │   │   │   ├──   folder.lua
│   │   │   │   ├──   font.lua
│   │   │   │   ├──   fzf.lua
│   │   │   │   ├──   image.lua
│   │   │   │   ├──   json.lua
│   │   │   │   ├──   magick.lua
│   │   │   │   ├──   mime.lua
│   │   │   │   ├──   noop.lua
│   │   │   │   ├──   pdf.lua
│   │   │   │   ├──   session.lua
│   │   │   │   ├──   video.lua
│   │   │   │   └──   zoxide.lua
│   │   │   ├──   compat.lua
│   │   │   ├──   setup.lua
│   │   │   └──   ya.lua
│   │   └──   Cargo.toml
│   ├──   Cargo.lock
│   ├──   Cargo.toml
│   ├──   CONTRIBUTING.md
│   ├──   cspell.json
│   ├──   flake.lock
│   ├──   flake.nix
│   ├──   LICENSE
│   ├──   LICENSE-ICONS
│   ├──   README.md
│   ├──   rustfmt.toml
│   └──   stylua.toml
├──   session.yazi
│   └──   session.lua
├──   smart-enter.yazi
│   └──   init.lua
├──   video.yazi
│   └──   video.lua
└──   zoxide.yazi
    └──   zoxide.lua

At ~/.local/state/yazi/yazi.log the only messages from the last 24h are about preloading images, nothing regarding the plugins.

2024-08-14T17:38:15.591007Z ERROR yazi_scheduler::prework::prework: Returned 2 when running preloader `image` with `/home/alberto/Documentos/Firma 2024 con calidad.png`
    at yazi-scheduler/src/prework/prework.rs:76
@moshpirit moshpirit added the bug Something isn't working label Aug 15, 2024
@xfzv
Copy link

xfzv commented Aug 15, 2024

Not sure why you added all these ~/.config/yazi/plugins/ directories, they're built-in plug-ins (except smart-enter.yazi). You can remove all of them.

Does the issue occur with stock config?

% mv ~/.config/yazi ~/.config/yazi.bak
% yazi

@moshpirit
Copy link
Author

Hmm seems like there's the issue, but still don't know why. This is my config file:

# A TOML linter such as https://taplo.tamasfe.dev/ can use this schema to validate your config.
# If you encounter any issues, please make an issue at https://github.com/yazi-rs/schemas.
"$schema" = "https://yazi-rs.github.io/schemas/yazi.json"

[manager]
ratio          = [ 1, 4, 3 ]
sort_by        = "modified"
sort_sensitive = true
sort_reverse   = true
sort_dir_first = true
linemode       = "none"
show_hidden    = false
show_symlink   = true

[preview]
tab_size        = 2
max_width       = 1000
max_height      = 2000
cache_dir       = ""
image_filter    = "triangle"
image_quality   = 75
sixel_fraction  = 15
ueberzug_scale  = 1
ueberzug_offset = [ 0, 0, 0, 0 ]

[opener]
edit = [
	{ run = '$EDITOR "$@"', block = true,  for = "unix" },
	{ run = 'code "%*"',    orphan = true, for = "windows" },
]
open = [
	{ run = 'xdg-open "$@"',                desc = "Open", for = "linux" },
	{ run = 'open "$@"',                    desc = "Open", for = "macos" },
	{ run = 'start "" "%1"', orphan = true, desc = "Open", for = "windows" }
]
reveal = [
	{ run = 'open -R "$1"',                          desc = "Reveal", for = "macos" },
	{ run = 'explorer /select, "%1"', orphan = true, desc = "Reveal", for = "windows" },
	{ run = '''exiftool "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show EXIF", for = "unix" },
]
extract = [
	{ run = 'unar "$1"', desc = "Extract here", for = "unix" },
	{ run = 'unar "%1"', desc = "Extract here", for = "windows" },
]
play = [
	{ run = 'mpv "$@"', orphan = true, for = "unix" },
	{ run = 'mpv "%1"', orphan = true, for = "windows" },
	{ run = '''mediainfo "$1"; echo "Press enter to exit"; read''', block = true, desc = "Show media info", for = "unix" },
]
open-image = [
  { run = 'feh -Z "$@"', orphan = true, desc = "feh" },
]

[open]
rules = [
	{ name = "*/", use = [ "edit", "open", "reveal" ] },

	{ mime = "text/*",  use = [ "edit", "reveal" ] },
	{ mime = "image/*", use = [ "open-image", "open", "reveal" ] },
	{ mime = "video/*", use = [ "play", "reveal" ] },
	{ mime = "audio/*", use = [ "play", "reveal" ] },
	{ mime = "inode/x-empty", use = [ "edit", "reveal" ] },

	{ mime = "application/json", use = [ "edit", "reveal" ] },
	{ mime = "*/javascript",     use = [ "edit", "reveal" ] },

	{ mime = "application/zip",             use = [ "extract", "reveal" ] },
	{ mime = "application/gzip",            use = [ "extract", "reveal" ] },
	{ mime = "application/x-tar",           use = [ "extract", "reveal" ] },
	{ mime = "application/x-bzip",          use = [ "extract", "reveal" ] },
	{ mime = "application/x-bzip2",         use = [ "extract", "reveal" ] },
	{ mime = "application/x-7z-compressed", use = [ "extract", "reveal" ] },
	{ mime = "application/x-rar",           use = [ "extract", "reveal" ] },
	{ mime = "application/xz",              use = [ "extract", "reveal" ] },

	{ mime = "*", use = [ "open", "reveal" ] },
]

[tasks]
micro_workers    = 10
macro_workers    = 25
bizarre_retry    = 5
image_alloc      = 536870912  # 512MB
image_bound      = [ 0, 0 ]
suppress_preload = false

[plugin]

preloaders = [
	# { name = "*", cond = "!mime", run = "mime", multi = true, prio = "high" },
	# Image
	{ mime = "image/vnd.djvu", run = "noop" },
	{ mime = "image/*",        run = "image" },
	# Video
	{ mime = "video/*", run = "video" },
	# PDF
	{ mime = "application/pdf", run = "pdf" },
]
previewers = [
	{ name = "*/", run = "folder", sync = true },
	# Code
	{ mime = "text/*",                 run = "code" },
	{ mime = "*/xml",                  run = "code" },
	{ mime = "*/javascript",           run = "code" },
	{ mime = "*/x-wine-extension-ini", run = "code" },
	# JSON
	{ mime = "application/json", run = "json" },
	# Image
	{ mime = "image/vnd.djvu", run = "noop" },
	{ mime = "image/*",        run = "image" },
	# Video
	{ mime = "video/*", run = "video" },
	# PDF
	{ mime = "application/pdf", run = "pdf" },
	# Archive
	{ mime = "application/zip",             run = "archive" },
	{ mime = "application/gzip",            run = "archive" },
	{ mime = "application/x-tar",           run = "archive" },
	{ mime = "application/x-bzip",          run = "archive" },
	{ mime = "application/x-bzip2",         run = "archive" },
	{ mime = "application/x-7z-compressed", run = "archive" },
	{ mime = "application/x-rar",           run = "archive" },
	{ mime = "application/xz",              run = "archive" },
	# Fallback
	{ name = "*", run = "file" },
]

[plugins]

preload = [
    "~/.config/yazi/init.lua",
    "~/.config/yazi/plugins/zoxide.yazi/zoxide.lua"

    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/zoxide.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/video.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/session.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/pdf.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/noop.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/mime.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/magick.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/json.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/image.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/fzf.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/font.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/folder.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/file.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/extract.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/empty.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/dds.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/code.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/archive.lua"
]

[input]
# cd
cd_title  = "Change directory:"
cd_origin = "top-center"
cd_offset = [ 0, 2, 50, 3 ]

# create
create_title  = "Create:"
create_origin = "top-center"
create_offset = [ 0, 2, 50, 3 ]

# rename
rename_title  = "Rename:"
rename_origin = "hovered"
rename_offset = [ 0, 1, 50, 3 ]

# trash
trash_title 	= "Move {n} selected file{s} to trash? (y/N)"
trash_origin	= "top-center"
trash_offset	= [ 0, 2, 50, 3 ]

# delete
delete_title 	= "Delete {n} selected file{s} permanently? (y/N)"
delete_origin	= "top-center"
delete_offset	= [ 0, 2, 50, 3 ]

# filter
filter_title  = "Filter:"
filter_origin = "top-center"
filter_offset = [ 0, 2, 50, 3 ]

# find
find_title  = [ "Find next:", "Find previous:" ]
find_origin = "top-center"
find_offset = [ 0, 2, 50, 3 ]

# search
search_title  = "Search via {n}:"
search_origin = "top-center"
search_offset = [ 0, 2, 50, 3 ]

# shell
shell_title  = [ "Shell:", "Shell (block):" ]
shell_origin = "top-center"
shell_offset = [ 0, 2, 50, 3 ]

# overwrite
overwrite_title  = "Overwrite an existing file? (y/N)"
overwrite_origin = "top-center"
overwrite_offset = [ 0, 2, 50, 3 ]

# quit
quit_title  = "{n} task{s} running, sure to quit? (y/N)"
quit_origin = "top-center"
quit_offset = [ 0, 2, 50, 3 ]

[select]
open_title  = "Open with:"
open_origin = "hovered"
open_offset = [ 0, 1, 50, 7 ]

[log]
enabled = false

@xfzv
Copy link

xfzv commented Aug 15, 2024

You can remove this:

[plugins]

preload = [
    "~/.config/yazi/init.lua",
    "~/.config/yazi/plugins/zoxide.yazi/zoxide.lua"

    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/zoxide.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/video.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/session.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/pdf.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/noop.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/mime.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/magick.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/json.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/image.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/fzf.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/font.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/folder.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/file.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/extract.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/empty.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/dds.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/code.lua",
    # "~/.config/yazi/plugins/plugins-del-github-de-yazi/yazi-plugin/preset/plugins/archive.lua"
]

Can you please post your keymap.toml?

Do you have

{ on = "z", run = "plugin zoxide", desc = "Jump to a directory using zoxide" },

in it?

@xfzv
Copy link

xfzv commented Aug 15, 2024

Also, just a heads up:

extract = [
	{ run = 'unar "$1"', desc = "Extract here", for = "unix" },
	{ run = 'unar "%1"', desc = "Extract here", for = "windows" },
]

there's a new built-in extractor since #1321 (and v0.3.0)

extract = [
{ run = 'ya pub extract --list "$@"', desc = "Extract here", for = "unix" },
{ run = 'ya pub extract --list %*', desc = "Extract here", for = "windows" },
]

There are other changes in yazi.toml preset compared to what you're currently using.

@moshpirit
Copy link
Author

Thanks, I didn't know that! Seems like it was an issue with the keymaps, so I've just removed the file because I didn't customize it and looks like it works, this way it should't create any other issues with new updates.

I tried leaving yazi.toml with only the changes so it creates the lesser impact as possible, but it seems like once there's a config file, it doesn't load the config file from anywhere else (even if there are variables not defined)

@sxyazi sxyazi added invalid This doesn't seem right and removed bug Something isn't working labels Aug 16, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

3 participants