fresh2dev / zellij-autolock

autolock Zellij when certain processes open.
MIT License
43 stars 2 forks source link

Error: Received empty message from sever #2

Open john-persson-polestar opened 4 months ago

john-persson-polestar commented 4 months ago

First off I'm very happy to see this project coming into existence. Thank you for creating it 🙏

I followed the installation steps including:

But when starting Zellij and trying to open NeoVim, Zellij crashes with this error message:

Received empty message from sever
fresh2dev commented 4 months ago

Hmm... OS?

john-persson-polestar commented 4 months ago

MacOs Sonoma 14.5

fresh2dev commented 4 months ago

I've only ever run this on Linux, but it should also work fine on MacOS.

Are there any hints in the Zellij log file?

fresh2dev commented 4 months ago

This seems related to https://github.com/zellij-org/zellij/issues/2170

Perhaps clearing the Zellij cache directory and restarting Zellij will resolve the issue (src: https://github.com/zellij-org/zellij/issues/2170#issuecomment-1451883326)

On MacOS, I think this done with:

rm -rf $HOME/Library/Caches/org.Zellij-Contributors.Zellij/

LMK :call_me_hand:

nffdiogosilva commented 4 months ago

Hello there. Like @john-persson-polestar , thanks for the effort in creating this. I have exactly the same OS version of @john-persson-polestar , and I have the same error, after following the installation guide.

Seeing the logs:

WARN   |zellij_utils::ipc        | 2024-06-01 16:16:54.442 [router    ] [zellij-utils/src/ipc.rs:226]: Error in IpcReceiver.recv(): InvalidMarkerRead(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })
ERROR  |zellij_client            | 2024-06-01 16:16:54.442 [router    ] [zellij-client/src/lib.rs:375]: Received empty message from server

The error happens whenever we press enter. Is related with this binding:

bind "Enter" {  // Intercept `Enter`.
    WriteChars "\u{000D}";  // Passthru `Enter`.
    MessagePlugin "autolock" {};  // Activate the autolock plugin.
}

P.S: I tried clear the cache beforehand.

EDIT: I also have the 0.40.1 installed.

john-persson-polestar commented 4 months ago

I also tried clearing the cache, but it didn't resolve the issue.

steven807 commented 3 months ago

Same experience, on MacOS Sonoma 14.4.1. Same log message (... zellij-utils-0.40.1/src/ipc.rs:226: Error in IpcReceiver.recv(): InvalidMarkerRead(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" })), and this is after clearing out the Zellij cache.

steven807 commented 3 months ago

Ah, I was able to get this working. The issue seems to be that specifying the location as https://github.com/fresh2dev/zellij-autolock/releases/latest/download/zellij-autolock.wasm didn't work for some reason (when I try curl -O ... it's a 0-length file). Instead, I downloaded the binary directly, put it in my $HOME/.config/zellij/plugins/ directory, and changed the plugins line to:

    autolock location="file:~/.config/zellij/plugins/zellij-autolock.wasm" {
    ...