-
-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
feat: Implement auto-detection of subexecutor #12261
base: master
Are you sure you want to change the base?
Conversation
# The alias provides a 'hardcoded', invariant subexecutor to use throughout the shell session | ||
alias _="$_SUBEX " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is taken out from lib/misc.zsh
because the definition of the alias now relies completely on what subexecutor is being used.
lib/termsupport.zsh
Outdated
# cmd name only, or if this is doas/sudo or ssh, the next cmd | ||
local _subex | ||
zstyle -s ':omz' 'subexecutor' _subex | ||
local CMD="${1[(wr)^(*=*|${_subex}|_|subex|mosh|rake|-*)]:gs/%/%%}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I replaced sudo
in the filter with ${_subex}|_|subex
for the following reasons:
- The subexecutor is not necessarily
sudo
now (can bedoas
, for instance) - There's an underscore
_
alias (previously defined inlib/misc.zsh
) that aliases the subexecutor - There's a new global function
subex
that also invokes the subexecutor
## super user alias | ||
alias _='sudo ' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to 00subexecutor.zsh
Didn't edit Edit: Okay just found out how the bot reads the CODEOWNERS file, so I guess I'll assume responsibility for that one file. Commit incoming. |
I willingly am taking up ownership and responsibility of the `lib/00subexecutor.zsh` file, and will review any changes to the file in the future.
One thing I'm not sure is where to document the (Setting that knob before starting up OMZ will disable the auto-detection mechanism and 'locks' the subexecutor for the session.) |
Just synced with latest OMZ master. No conflicts. |
Also documents the usage of `zstyle ':omz' subexecutor` to explicitly set the subexecutor being used.
README.md
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have decided to document the subexecutor auto-detection (and its related zstyle-based configuration knob) in OMZ's README.md, especially since there are mentions of other possible zstyle-based configuration in this file.
Accidentally removed 'ssh' from the set of commands to strip out.
1 month since last changes from my part (commit 7ddee97), and so far merging from ohmyzsh:master is no problem, and no conflicts. So, any blocking issues, @carlosala ? |
Hi @pepoluan! It's on our backlog, and we want to rethink it before merging. We're shaping a new architecture for omz that will arrive at some point, and we really want to make this part of it. |
Ah okay, fair enough. In the meantime I will keep updating the branch to sync with master. |
Standards checklist:
Changes:
00subexecutor.zsh
. The00
part is to ensure that it runs first, because it will set a certainzstyle
that is needed by other (patched) libraries.sudo
, to adapt to whatever subexecuter has been detected in00subexecutor.zsh
subex
that can be used in place of (parameterless)sudo
in all plugins, if we ever want to do the heavy-lifting of making all plugins have transparent support for non-sudo subexecutorOther comments:
This should close #12245
This PR modifies the core parts of OMZ, it is DIFFERENT from #11395, which has been closed anyways.