wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Better plugin development experience

Open bad-noodles opened this issue 1 month ago • 3 comments

Is your feature request related to a problem? Please describe. It is not easy to test your changes on a local plugin. If I change the code for a local plugin the changes don't get reflected, even if using the update_all function, you need to commit your changes for them to take effect.

Describe the solution you'd like A way to load an in-development plugin that gets updated in an easier way, hopefully automatically.

Describe alternatives you've considered I have been copying and pasting parts of my code between my config file and my plugin file to test it before I commit and validate it works as expected.

bad-noodles avatar Nov 23 '25 16:11 bad-noodles

Hello, Can you show how you're currently using your local plugin in your config? I'm not super familiar with wezterm plugins as I don't use that feature, but IIRC you can use a file:///path/to/plugin as the url to load a local plugins easily

bew avatar Nov 23 '25 20:11 bew

@bew Yes I am loading it like this: local stack = wezterm.plugin.require("file:///Users/rafa/dev/stack_wez")

The problem is it does not read directly from that folder. It copies the files to the same place it clones other plugins and my changes are not reflected unless I commit it, then it will copy the new version.

bad-noodles avatar Nov 23 '25 23:11 bad-noodles

@bad-noodles I agree with your view. I found it unproductive/troublesome developing a plugin using wezterm.plugin.require("file:///Users/rafa/dev/stack_wez") as it requires too many steps to implement a single change. Its great for loading and using a remote plugin that is already developed. It isn't great for developing a plugin from scratch.

To circumvent the unproductive workflow, presently I:

  1. First develop a plugin as a standard Lua module in one of the sub-directory of wezterm.config_dir and use Lua's require to load it in .
  2. After doing all the troubleshooting of the module, I then:
    1. copy its entire directory to /Users/rafa/dev/stack_wez/<name of plugin>/plugin. plugin is its new directory name.
    2. rename my module file to init.lua
    3. make changes to init.lua to accommodate all the requirements mentioned in https://github.com/wezterm/wezterm/blob/main/docs/config/plugins.md. To further circumvent unproductivity, I have even gone into ~/.local/share/wezterm/plugins/<name of plugin>/plugin/init.lua to make the changes there. Once everything works, I would then copy the changes into /Users/rafa/dev/stack_wez/<name of plugin>/plugin/init.lua.

I don't know how others create their plugins in a productive manner but the above is what I have figured out while developing my plugins. Do note that I am a relatively new user of WezTerm and not its expert.

Like you I too would like to see a way to load an in-development plugin that gets updated in an easier way, hopefully automatically.

sunbearc22 avatar Nov 25 '25 08:11 sunbearc22