Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add plugin aliases #5820

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Add plugin aliases #5820

wants to merge 9 commits into from

Conversation

MLFlexer
Copy link
Contributor

@MLFlexer MLFlexer commented Jul 15, 2024

This PR should solve #5812 and #4248 when complete.

I have changed the lua path to be able to call require("<plugin_name>.<some_lua_file>") as described here.
I have also added documentation for the wezterm.plugin and also added the functions wezterm.plugin.require_as_alias to clone repositories into a named directory.
Lastly i have added the wezterm.plugin.plugin_dir function to return the plugin directory root

@MLFlexer
Copy link
Contributor Author

Should also solve #4248

@MLFlexer MLFlexer marked this pull request as ready for review July 23, 2024 13:54
@@ -0,0 +1,9 @@
# `wezterm.plugin` module

{{since('???')}}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am unsure of how to get the correct version for these.

@yriveiro
Copy link

Thanks for this PR. I'm experimenting with Wezterm plugins and the experience is not too clean

It's impossible (as far as I know) to structure a plugin into different submodules. The submodules aren't found because the plugin is installed using the full URL path rather than a 'human-readable' name.

One question, Does this PR allow a Wezterm plugin to include another Wezterm plugin directly?

@MLFlexer
Copy link
Contributor Author

Thanks for this PR. I'm experimenting with Wezterm plugins and the experience is not too clean

It's impossible (as far as I know) to structure a plugin into different submodules. The submodules aren't found because the plugin is installed using the full URL path rather than a 'human-readable' name.

One question, Does this PR allow a Wezterm plugin to include another Wezterm plugin directly?

It would allow you to be able to do the following:

wezterm.plugin.require_as_alias("github.com/user/repo", "cool_plugin_alias")

cool_sub_module = require("cool_plugin_alias.sub_module")

Then the plugin author can specify that a user should install it with a specific alias, or alternatively the plugin could call the require_as_alias function itself and then use that to ensure that the plugin submodules are loaded. This would then allow a plugin to use another if needed as the plugins are just an extention of the configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants