You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 use doas
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 to sudo. Defining this will allow simple search-and-replace for most plugins to replace sudo with ${ZSH_SUBEXECUTOR}
For example:
alias nmap_slow="sudo nmap -sS -v -T1"
becomes
alias nmap_slow="${ZSH_SUBEXECUTOR} nmap -sS -v -T1"
Define an OMZ-level zstyle to contain the name of the subexecutor being used, defaults to sudo.
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:
alias nmap_slow="subex nmap -sS -v -T1"
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:
# If in the future a new subexecuter is created, we only need to edit this arraytypeset _KNOWN_SUBEXES=( "doas""sudo" )
typeset _SUBEX
for_iin"${_KNOWN_SUBEXES[@]}";doifcommand -v "$_i"> /dev/null;then
_subex="$_i"breakfidoneif [[ -z$_subex ]];then
_subex="sudo"fiunset _KNOWN_SUBEXES
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:
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.
I'd go for this with a zstyle-like config.
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: