zellij-org / zellij

A terminal workspace with batteries included
https://zellij.dev
MIT License
19.38k stars 610 forks source link

bug: `LaunchOrFocusPlugin` creates new plugin instances when using plugin aliases #3409

Open cristiand391 opened 3 weeks ago

cristiand391 commented 3 weeks ago

2. Issues with the Zellij UI / behavior / crash

Issue description

both the CLI action launch-or-focus-plugin and keybind action LaunchOrFocusPlugin create a new plugin instance instead of focusing on the existing one when using plugin aliases.

Workaround: use file schema URL

Minimal reproduction

  1. download zj-quit and set up an alias for it:
    plugins {
    zj-quit location="file:/path/to/zj-quit.wasm"
    }
  2. start zellij and launch it from the CLI with the launch-or-focus-plugin action using the plugin alias:
    zellij action launch-or-focus-plugin --floating zj-quit

press Esc to make it hide itself: https://github.com/cristiand391/zj-quit/blob/1ab13ff06af29215bba33ed03b116ef407acc8c1/src/main.rs#L40

repeat that 3 times and then open the session-manager and check the panes in the current tab, you should see this: image

note that there's 3 zj-quit panes instead of just 1.

now repeat step 2 but use the file schema URL:

zellij action launch-or-focus-plugin --floating "file:/path/to/zj-quit.wasm"

check the session-manager again, only 1 zj-quit instance is open.

Other relevant information

I noticed this first when using the keybind action, doesn't seem to affect the zellij: schema.

zellij --version: zellij 0.40.1