lib/cli.zsh (944 lines) and lib/diagnostics.zsh (353 lines) were parsed
on every startup to define functions that most shells never call. Move
them to $ZSH/functions/, which is already on $fpath, and autoload the
two entry points from oh-my-zsh.sh instead. The `omz` completion moves
to $ZSH/completions/_omz where compinit picks it up on its own.
Measured on macOS arm64, zsh 5.9: ~1.7 ms less per interactive start.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The plugin is a copy of the completion script shipped by symfony/console.
It has not been updated since it was added, and two fixes made upstream
since then are missing.
The completion request was assembled as a string from the raw words of
the command line, then passed to "eval". Any command substitution present
in a word was therefore executed by the completion, before the user
validated the line. The request is now run as an array of arguments,
without being read again by the shell, and "_describe" is called directly
instead of through "eval". The alias of the command is resolved
explicitly, since that was the only useful effect of the "eval".
The request also runs with SHELL_VERBOSITY=0, so that completion keeps
working for users who exported SHELL_VERBOSITY=-1.
Ported from symfony/symfony#65818 and symfony/symfony#63859.
Secret was the only resource in the plugin with get, describe and delete
aliases but no edit alias, while thirteen other resource types have one.
Closes#8309
Co-authored-by: Moulick Aggarwal <Moulick@users.noreply.github.com>
* fix(poetry-env): preserve venv in project subdirectories
Keep the active environment while navigating ordinary project children, but switch when entering a nested Poetry project.
Use a path-component boundary so similarly named sibling projects are not mistaken for subdirectories.
Fixes#12377
* fix(poetry-env): normalize active project root
* fix(pipenv): don't activate or leak errors when virtualenv is missing
* fix(pipenv): compare whole path components when deactivating
$PWD
$pipfile_dir is a string-prefix test, so moving from a project to an
unrelated sibling whose path merely starts with the same text (…/proj ->
…/proj-archive, …/projX) does not deactivate: the project's virtualenv
stays active in a directory that has no Pipfile. Require an exact match or
a component boundary instead. Subdirectories of the project keep their
current behaviour, and a project at / still matches everything.
* feat(uv-env): create plugin
This plugin automatically activates/deactivates a uv-managed virtual
environment when you cd into or out of a project directory. It looks
for pyproject.toml and uv.lock to detect a uv project, and reads
UV_PROJECT_ENVIRONMENT to support custom venv locations.
* fix(uv-env): address review feedback from robbyrussell
- Add `local` to venv_dir to prevent leaking into user's shell
- Replace `export` with `typeset -g` for uv_active and uv_dir
- Use `autoload -Uz` to match the style guide
asp() already writes its "profile not found" error to stderr and ends
with ${reset_color}; asr() printed its region error to stdout without a
reset, leaving the terminal red and mixing diagnostics into piped output.
Mirror asp() so both selection helpers behave the same.
Refs #13949
Rails applications can define more than one database (`primary`, `cache`, `cable`, `queue`, ...), and each one gets its own namespaced task. These commands accept an optional database name as the first argument:
`rdc`, `rdd`, `rdm`, `rdmd`, `rdmr`, `rdms`, `rdmu`, `rdr`, `rdrs`, `rdsl`
Co-authored-by: Robby Russell <robby@planetargon.com>
Since eza 0.23 `--hyperlink` is an option with an optional WHEN value
instead of a boolean flag, so a bare `--hyperlink` at the end of the
alias consumes the following argument:
$ ll ./tmp
error: invalid value './tmp' for '--hyperlink [<WHEN>]'
[possible values: always, auto, never]
Pass `--hyperlink=auto` (mirroring how the plugin already handles
`--icons=auto`) when eza accepts it, and fall back to the bare flag on
older releases.
Co-authored-by: Robby Russell <robby@planetargon.com>
Use `${0:A:h}` to get the absolute plugin directory path before entering
the anonymous function, where `$0` refers to the function itself. Store
it in a local variable to ensure the completion file path is resolved
correctly.
Fixes#14003
HOME="${HOME:-$(eval echo ~"$USER")}" expands any shell metacharacters in
$USER when HOME is unset (CWE-78), e.g. USER='x"; <command>; "'. Validate the
username against a safe character set before running the eval and fall back
to $PWD for unsafe values. Also quote $USER in the getent call to avoid word
splitting.
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
* chore(z): update to 102fb780
* remove tests
* do not include tests
---------
Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com>
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
BREAKING CHANGE: `kubectx_prompt_info` uses the async prompt API by default on supported zsh versions. Set async-prompt to no for synchronous behavior, or force it when calling it through a wrapper function. See the plugin README for details.
Adds a cache policy for the `gi` command completion function, i.e.
`_gitignoreio`. Previously, every completion call would request the list
endpoint of gitignore.io over the network, resulting in a delay between
pressing <Tab> and the autocomplete options showing up.
Since we don't expect the gitignore.io templates to change that
frequently, configured the cache policy to expire after 7 days.
Signed-off-by: Rishvic Pushpakaran <rishvic@gmail.com>
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
The issue is that Ghostty shell-integration tries to parse PS1. How we're
defining it now, the precmd function from Ghostty does not properly read
the newlines, resulting in broken prompts. This doesn't happen if:
- Zsh is reloaded (`omz reload` or `exec zsh`)
- Ghostty shell integration is disabled (`shell-integration = none` in config)
This fix just removes the newlines, and it's enough to fix the integration.