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
Provide OMZ-wide option to specify subexecutor such as doas
#12245
Labels
Feature
New feature or request
Comments
pepoluan
changed the title
Provide OMZ-wide option to specify subexecutor
Provide OMZ-wide option to specify subexecutor such as Feb 29, 2024
doas
What do you think about this @mcornella? I'd say it's a good option, it could be a great possibility to make it configurable even to some random script that, for example, asks for confirmation or something like that by any user. |
8 tasks
After some consideration, I decided to take the merging of Alternatives 2 & 3, and have submitted PR #12261 implementing this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If the feature request is for a plugin or theme, specify it here.
No response
If the feature solves a problem you have, specify it here.
I am using Gentoo Linux, and I don't use
sudo
for subexecutor. Rather, I usedoas
Unfortunately, all plugins that use a subexecutor to do their work, are hardcoded using
sudo
.I propose having an OMZ-wide knob that allows plugins to automatically adjust to whatever subexecutor is being used.
Describe the proposed feature.
There are several alternatives:
Define
ZSH_SUBEXECUTOR
that, by default, is set tosudo
. Defining this will allow simple search-and-replace for most plugins to replacesudo
with${ZSH_SUBEXECUTOR}
For example:
becomes
Define an OMZ-level
zstyle
to contain the name of the subexecutor being used, defaults tosudo
.This will need some code in the plugins. So, to use the above example, will become:
Define a global OMZ function that adjusts the call to subexecutor automatically. Let's call it
subex
.So the above example becomes:
The function may internally be referring to an env var and/or a zstyle knob to provide manual override.
Describe alternatives you've considered
An alternative is to add the following code for all plugins:
However, if we add this code to all plugins that define
sudo
as part of their sets of aliases, that is highly inefficient since the code will be duplicated over all impacted plugins.Furthermore this code does not provide a way to temporarily override the subexecutor being used.
Additional context
No response
Related Issues
This is tangentially related to this discussion: #11947 , specifically this comment which mentions the
doas
command.So if this issue gets solved, the solution will provide partial solution to the challenge discussed, specifically for *BSD users that use the
doas
command.The text was updated successfully, but these errors were encountered: