feat(plugins): introduce plugin aliases #3157
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces "plugin aliases". These are arbitrary strings that can be assigned to a specific plugin (either a builtin
zellij:
plugin, a localfile:
plugin or a remotehttp(s):
plugin).Whenever Zellij encounters such an alias (be it when launching a plugin from the CLI, with a pipe, in a layout, or when launching a plugin through another plugin) it will replace the alias with the correct plugin if it knows it. Aliases can also optionally include plugin configuration.
These aliases can be defined in the Zellij configuration under the existing
plugins
block which has been repurposed for this case:The old configuration block items will be ignored.
Since the built-in layouts now use these aliases (eg. the default layout now uses
status-bar
instead ofzellij:status-bar
), this can be a much easier way to integrate plugins. For example:This will cause
zjstatus
to be loaded instead of thecompact-bar
whenever thecompact
layout is used, without the need to define a custom layout and swap layouts.These will also be especially useful as a generic interface when developing plugins and referring to well-known conventions. For example, using the
filepicker
alias in order to get the user to choose a file using whichever filepicker plugin they have defined, without the initiating plugin having to know the specifics about said filepicker plugin.P.S.
This PR also removes the filesystem watching from strider, which was left there by accident. It should solve most bugs about strider not starting properly.