dedukun / bookmarks.yazi

MIT License
59 stars 2 forks source link

Error in background task #8

Closed ndtoan96 closed 6 months ago

ndtoan96 commented 6 months ago

I tried the plugin, the functionalities work fine. But every time I add new bookmark with m <some char>. There's a task fail in the background with these message:

Micro plugin failed:
Failed to execute sync block-1 in `bookmarks` plugin
stack traceback:
        [C]: in local 'poll'
        [string "?"]:4: in main chunk
        (...tail calls...)
        [string "C:\Users\ASUS\.cargo\git\checkouts\yazi-d41f8..."]:78: in function <[string "C:\Users\ASUS\.cargo\git\checkouts\yazi-d41f8..."]:69>

I'm on Windows 11. Any idea about this?

dedukun commented 6 months ago

I've never seen that error, but I never tested the plugin in Windows, I'll bring up a VM to do that.

Just a question, what version/commit of Yazi are you using and what's your terminal? If you are on one of the latest commits of Yazi, you can just put the output of yazi --debug here.

ndtoan96 commented 6 months ago

I use latest main branch yazi on Windows terminal. Below is the output of yazi --debug.

Yazi
    Version: 0.2.4 (9918ceb 2024-03-21)
    OS: windows-x86_64 (windows)
    Debug: false

Emulator
    Emulator.via_env: ("", "")
    Emulator.via_csi: Ok(Unknown([]))
    Emulator.detect: Unknown([])

Adaptor
    Adaptor.matches: Chafa

Desktop
    XDG_SESSION_TYPE: None
    WAYLAND_DISPLAY: None
    DISPLAY: None

SSH
    shared.in_ssh_connection: false

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

Variables
    EDITOR: Some("hx")
    ZELLIJ_SESSION_NAME: None
    YAZI_FILE_ONE: Some("C:\\Program Files\\Git\\usr\\bin\\file.exe")
    YAZI_CONFIG_HOME: None

file(1)
    Version: Err(Error { kind: NotFound, message: "program not found" })

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

Ueberzug++
    Version: Err(Error { kind: NotFound, message: "program not found" })
dedukun commented 6 months ago

You didn't run the setup function right?

I've fixed a bug now where the notifications crashed if the setup function wasn't run in init.lua.

ndtoan96 commented 6 months ago

It works. Thanks.

Btw, the instruction to run setup function is kinda not obvious. I thought the init.lua is pointing to the plugin one. Didn't know there's a config/init.lua too.

dedukun commented 6 months ago

Since the commit from yesterday it is only required to run the setup function if the user wants to enable notifications, but yes, its not obvious right now, specially where the function must be added. I'll update the README to try to make it clearer.