From 276e540eed9c47d11539dfcd056cd9d162e1c732 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Fri, 10 Jan 2025 14:11:33 +0100 Subject: [PATCH 01/62] fix(cli): ensure `ksharrays` is unset Closes #12900 --- lib/cli.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/cli.zsh b/lib/cli.zsh index 38a84840c..c63185a3d 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -1,6 +1,7 @@ #!/usr/bin/env zsh function omz { + setopt localoptions noksharrays [[ $# -gt 0 ]] || { _omz::help return 1 From cae2e451933ffe1108bfd00fa67ff5d63741ab85 Mon Sep 17 00:00:00 2001 From: Thomas Date: Fri, 10 Jan 2025 14:17:49 +0100 Subject: [PATCH 02/62] fix(rust): call `rustc` through `rustup run` (#12901) --- plugins/rust/rust.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rust/rust.plugin.zsh b/plugins/rust/rust.plugin.zsh index 858f14126..567cebc64 100644 --- a/plugins/rust/rust.plugin.zsh +++ b/plugins/rust/rust.plugin.zsh @@ -22,5 +22,5 @@ fi rustup completions zsh >| "$ZSH_CACHE_DIR/completions/_rustup" &| cat >| "$ZSH_CACHE_DIR/completions/_cargo" <<'EOF' #compdef cargo -source "$(rustc +${${(z)$(rustup default)}[1]} --print sysroot)"/share/zsh/site-functions/_cargo +source "$(rustup run ${${(z)$(rustup default)}[1]} rustc --print sysroot)"/share/zsh/site-functions/_cargo EOF From 7a3695aadf51aaa24e79175b1684d4836e31956d Mon Sep 17 00:00:00 2001 From: Michele Bologna Date: Sun, 12 Jan 2025 14:25:00 +0100 Subject: [PATCH 03/62] fix(grc): add linuxbrew path (#12903) --- plugins/grc/grc.plugin.zsh | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/grc/grc.plugin.zsh b/plugins/grc/grc.plugin.zsh index 55ffc1a1e..fc6ecc8ac 100644 --- a/plugins/grc/grc.plugin.zsh +++ b/plugins/grc/grc.plugin.zsh @@ -5,6 +5,7 @@ files=( /etc/grc.zsh # default /usr/local/etc/grc.zsh # homebrew darwin-x64 /opt/homebrew/etc/grc.zsh # homebrew darwin-arm64 + /home/linuxbrew/.linuxbrew/etc/grc.zsh # linuxbrew /usr/share/grc/grc.zsh # Gentoo Linux (app-misc/grc) ) From 04cba220f7bd7b27483a5b346e2ca717f0341895 Mon Sep 17 00:00:00 2001 From: Nico Just Date: Wed, 15 Jan 2025 12:40:52 +0100 Subject: [PATCH 04/62] feat(eza): add color-scale options (#12841) --- plugins/eza/README.md | 23 +++++++++++++++++++++++ plugins/eza/eza.plugin.zsh | 8 ++++++++ 2 files changed, 31 insertions(+) diff --git a/plugins/eza/README.md b/plugins/eza/README.md index 90e549994..bec1f85cb 100644 --- a/plugins/eza/README.md +++ b/plugins/eza/README.md @@ -65,6 +65,29 @@ If `yes`, sets the `--icons` option of `eza`, adding icons for files and folders Default: `no` +### `color-scale` + +```zsh +zstyle ':omz:plugins:eza' 'color-scale' all|age|size +``` + +Highlight levels of field(s) distinctly. Use comma(,) separated list of `all`, `age`, `size` + +Default: `none` + +### `color-scale-mode` + +```zsh +zstyle ':omz:plugins:eza' 'color-scale-mode' gradient|fixed +``` + +Choose the mode for highlighting: + +- `gradient` (default) -- gradient coloring +- `fixed` -- fixed coloring + +Default: `gradient` + ### `size-prefix` ```zsh diff --git a/plugins/eza/eza.plugin.zsh b/plugins/eza/eza.plugin.zsh index f25f1c30b..60ed1eb27 100644 --- a/plugins/eza/eza.plugin.zsh +++ b/plugins/eza/eza.plugin.zsh @@ -34,6 +34,14 @@ function _configure_eza() { if zstyle -t ':omz:plugins:eza' 'icons'; then _EZA_TAIL+=("--icons=auto") fi + zstyle -s ':omz:plugins:eza' 'color-scale' _val + if [[ $_val ]]; then + _EZA_TAIL+=("--color-scale=$_val") + fi + zstyle -s ':omz:plugins:eza' 'color-scale-mode' _val + if [[ $_val == (gradient|fixed) ]]; then + _EZA_TAIL+=("--color-scale-mode=$_val") + fi zstyle -s ':omz:plugins:eza' 'time-style' _val if [[ $_val ]]; then _EZA_TAIL+=("--time-style='$_val'") From 028d65363230b4aa54f3aaa14e03237243a2f1d8 Mon Sep 17 00:00:00 2001 From: Abhijeet Vashistha Date: Wed, 15 Jan 2025 21:33:32 +0530 Subject: [PATCH 05/62] fix(sonicradish): reset color typo (#12912) --- themes/sonicradish.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/sonicradish.zsh-theme b/themes/sonicradish.zsh-theme index db6170969..11d66a27e 100644 --- a/themes/sonicradish.zsh-theme +++ b/themes/sonicradish.zsh-theme @@ -29,7 +29,7 @@ ZSH_THEME_GIT_PROMPT_SUFFIX="%{$GIT_PROMPT_INFO%} :" ZSH_THEME_GIT_PROMPT_DIRTY=" %{$GIT_DIRTY_COLOR%}✘" ZSH_THEME_GIT_PROMPT_CLEAN=" %{$GIT_CLEAN_COLOR%}✔" -ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[103]%}✚%{$rset_color%}" +ZSH_THEME_GIT_PROMPT_ADDED="%{$FG[103]%}✚%{$reset_color%}" ZSH_THEME_GIT_PROMPT_MODIFIED="%{$FG[103]%}✹%{$reset_color%}" ZSH_THEME_GIT_PROMPT_DELETED="%{$FG[103]%}✖%{$reset_color%}" ZSH_THEME_GIT_PROMPT_RENAMED="%{$FG[103]%}➜%{$reset_color%}" From 8c5b71b2f430283d0e9404ad1d2b470ed336aaab Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sun, 19 Jan 2025 04:18:37 -0600 Subject: [PATCH 06/62] ci(deps): update `gitfast` to its new structure (#12922) Co-authored-by: Carlo Sala --- .github/dependencies.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 3386e55a0..2c92aee52 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -5,8 +5,10 @@ dependencies: version: tag:v2.1 postcopy: | set -e - rm -rf git-completion.plugin.zsh Makefile README.adoc t tools - test -e git-completion.zsh && mv -f git-completion.zsh _git + rm -rf git-completion.plugin.zsh Makefile t tools + mv README.adoc MANUAL.adoc + mv -f src/* . + rmdir src plugins/gradle: repo: gradle/gradle-completion branch: master From d689aa289e5dcda7c35b907af62bd08feb679b37 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 11:20:14 +0100 Subject: [PATCH 07/62] feat(gitfast): update to version v2.2 (#12923) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/gitfast/MANUAL.adoc | 40 +++++++++++++++++++++++++++++ plugins/gitfast/_git | 18 +++---------- plugins/gitfast/git-completion.bash | 2 ++ 4 files changed, 46 insertions(+), 16 deletions(-) create mode 100644 plugins/gitfast/MANUAL.adoc diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 2c92aee52..02995d6cd 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -2,7 +2,7 @@ dependencies: plugins/gitfast: repo: felipec/git-completion branch: master - version: tag:v2.1 + version: tag:v2.2 postcopy: | set -e rm -rf git-completion.plugin.zsh Makefile t tools diff --git a/plugins/gitfast/MANUAL.adoc b/plugins/gitfast/MANUAL.adoc new file mode 100644 index 000000000..5333f5a2c --- /dev/null +++ b/plugins/gitfast/MANUAL.adoc @@ -0,0 +1,40 @@ +This project is a friendly fork of the official Git completion +(`contrib/completion`) and prompt scripts for Bash, Zsh, and possibly other +shells. + +Most Git developers use the Bash shell, for which the completion scripts work +rather well, however, Zsh is typically neglected. I've sent many patches to fix +the issues, many have been merged, but many have been ignored, thus the need for +a canonical location of a good, working Zsh completion. + +There are advantages for Bash users too. Currently the scripts under `contrib` are tied to the +specific Git version, for example the completion scripts of version v2.40 +(https://git.kernel.org/pub/scm/git/git.git/plain/contrib/completion/git-completion.bash?h=v2.40.0[git-completion.bash]) +have issues with older versions of Git (e.g. v2.33); the ones in +this project don't. + +With `git-completion` you can be sure you are using the latest completion that +works in both shells, and any Git version. + +This is a sister project of the +https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/gitfast[Oh My Zsh +gitfast] plugin (that I also maintain), which has similar needs. + +== Installation == + +* https://github.com/felipec/git-completion/wiki/Bash[Bash instructions] +* https://github.com/felipec/git-completion/wiki/Zsh[Zsh instructions] + +== Improvements from upstream == + +This is a short list of the benefits you get: + +* Easier installation +* Tons of bug fixes +* Works with older versions of git +* Zsh: much more options +* Zsh: quoting works properly +* Zsh: automatic suffix removal + +For a full list of all the patches on top of upstream git check +https://github.com/felipec/git-completion/wiki/Patches[Patches]. diff --git a/plugins/gitfast/_git b/plugins/gitfast/_git index 31bf88c1c..1283c713e 100644 --- a/plugins/gitfast/_git +++ b/plugins/gitfast/_git @@ -2,23 +2,11 @@ # zsh completion wrapper for git # -# Copyright (c) 2012-2020 Felipe Contreras +# Copyright (c) 2012-2024 Felipe Contreras # -# The recommended way to install this script is to make a copy of it as a -# file named '_git' inside any directory in your fpath. +# The recommended way to use this script is to prepend its location to your $fpath: # -# For example, create a directory '~/.zsh/', copy this file to '~/.zsh/_git', -# and then add the following to your ~/.zshrc file: -# -# fpath=(~/.zsh $fpath) -# -# You need git's bash completion script installed. By default bash-completion's -# location will be used (e.g. pkg-config --variable=completionsdir bash-completion). -# -# If your bash completion script is somewhere else, you can specify the -# location in your ~/.zshrc: -# -# zstyle ':completion:*:*:git:*' script ~/.git-completion.bash +# fpath=($git_completion_srcdir $fpath) # zstyle -T ':completion:*:*:git:*' tag-order && \ diff --git a/plugins/gitfast/git-completion.bash b/plugins/gitfast/git-completion.bash index 9a2045f26..8a790ca69 100644 --- a/plugins/gitfast/git-completion.bash +++ b/plugins/gitfast/git-completion.bash @@ -1,6 +1,8 @@ # bash/zsh completion support for core Git. # # Copyright (C) 2006,2007 Shawn O. Pearce +# Copyright (c) 2012-2024 Felipe Contreras +# # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). # Distributed under the GNU General Public License, version 2.0. # From 6e9cda3d30d8e73c11e4d32044b7f4c5e06f822d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 23:30:40 +0100 Subject: [PATCH 08/62] chore(deps): bump semver in /.github/workflows/dependencies (#12924) Bumps [semver](https://github.com/python-semver/python-semver) from 3.0.2 to 3.0.3. - [Release notes](https://github.com/python-semver/python-semver/releases) - [Changelog](https://github.com/python-semver/python-semver/blob/master/CHANGELOG.rst) - [Commits](https://github.com/python-semver/python-semver/compare/3.0.2...3.0.3) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index a3922cd03..d8149743c 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -3,5 +3,5 @@ charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 requests==2.32.3 -semver==3.0.2 +semver==3.0.3 urllib3==2.3.0 From cca4043238421ae8e018720326d5357027f27cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 19:54:50 +0100 Subject: [PATCH 09/62] feat(python): support multiple venvs via `$PYTHON_VENV_NAMES` (#12932) --- plugins/python/README.md | 45 ++++++++++++++++++++++++++------ plugins/python/python.plugin.zsh | 26 +++++++++++++++--- 2 files changed, 59 insertions(+), 12 deletions(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 8014992de..490cf88f1 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -24,16 +24,45 @@ plugins=(... python) The plugin provides three utilities to manage Python 3.3+ [venv](https://docs.python.org/3/library/venv.html) virtual environments: -- `mkv [name]`: make a new virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else - `venv`) in the current directory. +- `mkv [name]`: make a new virtual environment called `name` in the current directory. + **Default**: `$PYTHON_VENV_NAME` if set, otherwise `venv`. -- `vrun [name]`: Activate the virtual environment called `name` (default: if set `$PYTHON_VENV_NAME`, else - `venv`) in the current directory. +- `vrun [name]`: activate the virtual environment called `name` in the current directory. + **Default**: the first existing in `$PYTHON_VENV_NAMES`. -- `auto_vrun`: Automatically activate the venv virtual environment when entering a directory containing +- `auto_vrun`: automatically activate the venv virtual environment when entering a directory containing `/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated in subdirectories). - - To enable the feature, set `export PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. - - Plugin activates first virtual environment in lexicographic order whose name begins with ``. + - To enable the feature, set `PYTHON_AUTO_VRUN=true` before sourcing oh-my-zsh. + - The plugin activates the first existing virtual environment, in order, appearing in `$PYTON_VENV_NAMES`. The default virtual environment name is `venv`. To use a different name, set - `export PYTHON_VENV_NAME=`. For example: `export PYTHON_VENV_NAME=".venv"` + `PYTHON_VENV_NAME=`. For example: `PYTHON_VENV_NAME=".venv"` + +### Settings + +You can set these variables in your `.zshrc` file, before Oh My Zsh is sourced. +For example: + +```sh +PYTHON_VENV_NAME=".venv" +PYTHON_VENV_NAMES=($PYTHON_VENV_NAME venv) +... +plugins=(... python) +source "$ZSH/oh-my-zsh.sh" +``` + + +## `$PYTHON_VENV_NAME` + +**Default**: `venv`. + +Preferred name for virtual environments, for example when creating via `mkv`. + +## `$PYTHON_VENV_NAMES` + +**Default**: `$PYTHON_VENV_NAME venv .venv`. + +Array of virtual environment names to be checked, in order, by `vrun` and `auto_vrun`. +This means these functions will load the first existing virtual environment in this list. +Duplicate names are ignored. + diff --git a/plugins/python/python.plugin.zsh b/plugins/python/python.plugin.zsh index 63733e1de..2b139ddf0 100644 --- a/plugins/python/python.plugin.zsh +++ b/plugins/python/python.plugin.zsh @@ -47,12 +47,29 @@ alias pygrep='grep -nr --include="*.py"' alias pyserver="python3 -m http.server" -## venv utilities +## venv settings : ${PYTHON_VENV_NAME:=venv} +# Array of possible virtual environment names to look for, in order +# -U for removing duplicates +typeset -gaU PYTHON_VENV_NAMES +[[ -n "$PYTHON_VENV_NAMES" ]] || PYTHON_VENV_NAMES=($PYTHON_VENV_NAME venv .venv) + # Activate a the python virtual environment specified. -# If none specified, use $PYTHON_VENV_NAME, else 'venv'. +# If none specified, use the first existing in $PYTHON_VENV_NAMES. function vrun() { + if [[ -z "$1" ]]; then + local name + for name in $PYTHON_VENV_NAMES; do + local venvpath="${name:P}" + if [[ -d "$venvpath" ]]; then + vrun "$name" + return $? + fi + done + echo >&2 "Error: no virtual environment found in current directory" + fi + local name="${1:-$PYTHON_VENV_NAME}" local venvpath="${name:P}" @@ -91,10 +108,11 @@ if [[ "$PYTHON_AUTO_VRUN" == "true" ]]; then fi if [[ $PWD != ${VIRTUAL_ENV:h} ]]; then - for _file in "${PYTHON_VENV_NAME}"*/bin/activate(N.); do + local file + for file in "${^PYTHON_VENV_NAMES[@]}"/bin/activate(N.); do # make sure we're not in a venv already (( $+functions[deactivate] )) && deactivate > /dev/null 2>&1 - source $_file > /dev/null 2>&1 + source $file > /dev/null 2>&1 break done fi From 501f29f90c67bfb47506715c894e710c46ae3e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 20:10:10 +0100 Subject: [PATCH 10/62] fix(tailscale): fix completion binding for alias to `Tailscale` (#12928) Fixes #12928 --- plugins/tailscale/tailscale.plugin.zsh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/tailscale/tailscale.plugin.zsh b/plugins/tailscale/tailscale.plugin.zsh index e0e011196..8b4e1e34d 100644 --- a/plugins/tailscale/tailscale.plugin.zsh +++ b/plugins/tailscale/tailscale.plugin.zsh @@ -15,4 +15,11 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_tailscale" ]]; then fi fi +# If using the alias, let's make sure that the aliased executable is also bound +# in case the alias points to "Tailscale" instead of "tailscale". +# See https://github.com/ohmyzsh/ohmyzsh/discussions/12928 +if (( $+aliases[tailscale] )); then + _comps[${aliases[tailscale]:t}]=_tailscale +fi + tailscale completion zsh >| "$ZSH_CACHE_DIR/completions/_tailscale" &| From 9a0e22c184f4348b4bda4cd3de306d65eb541341 Mon Sep 17 00:00:00 2001 From: jamesrtnz Date: Fri, 24 Jan 2025 08:24:43 +1300 Subject: [PATCH 11/62] feat(perl): add `perlbrew` auto activation (#12814) Co-authored-by: Carlo Sala --- plugins/perl/README.md | 40 +++++++++++++++++++++--------------- plugins/perl/perl.plugin.zsh | 9 ++++++++ 2 files changed, 32 insertions(+), 17 deletions(-) diff --git a/plugins/perl/README.md b/plugins/perl/README.md index dd9b7dc75..a387455c1 100644 --- a/plugins/perl/README.md +++ b/plugins/perl/README.md @@ -8,30 +8,36 @@ To use it, add `perl` to the plugins array in your zshrc file: plugins=(... perl) ``` +## Perlbrew activation + +If the plugin detects that `perlbrew` hasn't been activated, yet there is an installation of it in +`$PERLBREW_ROOT`, it'll initialize by default. To avoid this behaviour, set `ZSH_PERLBREW_ACTIVATE=false` +before `source oh-my-zsh.sh` in your zshrc. + ## Aliases -| Aliases | Command | Description | -| :------------ | :----------------- | :------------------------------------- | -| pbi | `perlbrew install` | Install specific perl version | -| pbl | `perlbrew list` | List all perl version installed | -| pbo | `perlbrew off` | Go back to the system perl | -| pbs | `perlbrew switch` | Turn it back on | -| pbu | `perlbrew use` | Use specific version of perl | -| pd | `perldoc` | Show the perl documentation | -| ple | `perl -wlne` | Use perl like awk/sed | -| latest-perl | `curl ...` | Show the latest stable release of Perl | +| Aliases | Command | Description | +| :---------- | :----------------- | :------------------------------------- | +| pbi | `perlbrew install` | Install specific perl version | +| pbl | `perlbrew list` | List all perl version installed | +| pbo | `perlbrew off` | Go back to the system perl | +| pbs | `perlbrew switch` | Turn it back on | +| pbu | `perlbrew use` | Use specific version of perl | +| pd | `perldoc` | Show the perl documentation | +| ple | `perl -wlne` | Use perl like awk/sed | +| latest-perl | `curl ...` | Show the latest stable release of Perl | ## Functions -* `newpl`: creates a basic Perl script file and opens it with $EDITOR. +- `newpl`: creates a basic Perl script file and opens it with $EDITOR. -* `pgs`: Perl Global Substitution: `pgs ` - Looks for `` and replaces it with `` in ``. +- `pgs`: Perl Global Substitution: `pgs ` Looks for + `` and replaces it with `` in ``. -* `prep`: Perl grep, because 'grep -P' is terrible: `prep []` - Lets you work with pipes or files (if no `` provided, use stdin). +- `prep`: Perl grep, because 'grep -P' is terrible: `prep []` Lets you work with pipes or + files (if no `` provided, use stdin). ## Requirements -In order to make this work, you will need to have perl installed. -More info on the usage and install: https://www.perl.org/get.html +In order to make this work, you will need to have perl installed. More info on the usage and install: +https://www.perl.org/get.html diff --git a/plugins/perl/perl.plugin.zsh b/plugins/perl/perl.plugin.zsh index 678e88d97..137fa252a 100644 --- a/plugins/perl/perl.plugin.zsh +++ b/plugins/perl/perl.plugin.zsh @@ -54,3 +54,12 @@ pgs() { # [find] [replace] [filename] prep() { # [pattern] [filename unless STDOUT] perl -nle 'print if /'"$1"'/;' $2 } + +# If the 'perlbrew' function isn't defined, perlbrew isn't setup. +if [[ $ZSH_PERLBREW_ACTIVATE != false ]] && (( ! $+functions[perlbrew] )); then + local _perlbrew="${PERLBREW_ROOT:-${HOME}/perl5/perlbrew}" + if [[ -f "${_perlbrew}/etc/bashrc" ]]; then + source "${_perlbrew}/etc/bashrc" + fi + unset _perlbrew +fi From bd0a5b2598f5614aa60b056783cd3acb803c664a Mon Sep 17 00:00:00 2001 From: Keith Bennett Date: Fri, 24 Jan 2025 02:28:44 +0700 Subject: [PATCH 12/62] docs(chucknorris): add useful note (#12822) --- plugins/chucknorris/README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/chucknorris/README.md b/plugins/chucknorris/README.md index 0562b3b59..655e7cf11 100644 --- a/plugins/chucknorris/README.md +++ b/plugins/chucknorris/README.md @@ -36,3 +36,10 @@ Last login: Fri Jan 30 23:12:26 on ttys001 - `cowsay` if using `chuck_cow` Available via homebrew, apt, ... + +> [!NOTE] +> In addition to installing `fortune`, it may be necessary to run: +> +> `strfile $ZSH/plugins/chucknorris/fortunes/chucknorris\n` +> +> (include the "\n" literally) to write the fortune data to the proper directory. From 1bae19973671dde75506c541ba576de4dae8cb29 Mon Sep 17 00:00:00 2001 From: Thomas Boyer Date: Thu, 23 Jan 2025 20:37:00 +0100 Subject: [PATCH 13/62] fix(direnv): warn user if command not found (#12840) Co-authored-by: Carlo Sala --- plugins/direnv/direnv.plugin.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/direnv/direnv.plugin.zsh b/plugins/direnv/direnv.plugin.zsh index 0a33194dd..c026dbe76 100644 --- a/plugins/direnv/direnv.plugin.zsh +++ b/plugins/direnv/direnv.plugin.zsh @@ -1,5 +1,8 @@ -# Don't continue if direnv is not found -command -v direnv &>/dev/null || return +# If direnv is not found, don't continue and print a warning +if (( ! $+commands[direnv] )); then + echo "Warning: direnv not found. Please install direnv and ensure it's in your PATH before using this plugin." + return +fi _direnv_hook() { trap -- '' SIGINT; From 4e29c670a48a17276d04b3e47262b10f28dfcc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 20:38:12 +0100 Subject: [PATCH 14/62] fix(changelog): show if there are no changes (#12934) --- tools/changelog.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tools/changelog.sh b/tools/changelog.sh index c4b26079e..ff409115f 100755 --- a/tools/changelog.sh +++ b/tools/changelog.sh @@ -400,6 +400,9 @@ function display-release { function display:breaking { (( $#breaking != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + case "$output" in text) printf '\e[31m'; fmt:header "BREAKING CHANGES" 3 ;; raw) fmt:header "BREAKING CHANGES" 3 ;; @@ -427,6 +430,9 @@ function display-release { # If no commits found of type $type, go to next type (( $#hashes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "${TYPES[$type]}" 3 for hash in $hashes; do echo " - $(fmt:hash) $(fmt:scope)$(fmt:subject)" @@ -444,6 +450,9 @@ function display-release { # If no commits found under "other" types, don't display anything (( $#changes != 0 )) || return 0 + # If we reach here we have shown commits, set flag + shown_commits=1 + fmt:header "Other changes" 3 for hash type in ${(kv)changes}; do case "$type" in @@ -498,7 +507,7 @@ function main { # Commit classification arrays local -A types subjects scopes breaking reverts - local truncate=0 read_commits=0 + local truncate=0 read_commits=0 shown_commits=0 local version tag local hash refs subject body @@ -569,6 +578,10 @@ function main { echo " ...more commits omitted" echo fi + + if (( ! shown_commits )); then + echo "No changes to mention." + fi } # Use raw output if stdout is not a tty From 69410e702014b6f6f09f659a5747c5a6ace7a09a Mon Sep 17 00:00:00 2001 From: fossdd Date: Thu, 23 Jan 2025 20:43:27 +0100 Subject: [PATCH 15/62] feat(foot): add foot plugin (#12849) --- plugins/foot/README.md | 35 +++++++++++++++++++++++++++++++++++ plugins/foot/foot.plugin.zsh | 10 ++++++++++ 2 files changed, 45 insertions(+) create mode 100644 plugins/foot/README.md create mode 100644 plugins/foot/foot.plugin.zsh diff --git a/plugins/foot/README.md b/plugins/foot/README.md new file mode 100644 index 000000000..67777d9fa --- /dev/null +++ b/plugins/foot/README.md @@ -0,0 +1,35 @@ +# foot + +This plugin adds shell integration for [foot, a fast, lightweight and +minimalistic Wayland terminal emulator](https://codeberg.org/dnkl/foot). + +To use, add `foot` to the list of plugins in your `.zshrc` file: + +```zsh +plugins=(... foot) +``` + +## Spawning new terminal instances in the current working directory + +When spawning a new terminal instance (with `ctrl+shift+n` by default), the new +instance will start in the current working directory. + +## Jumping between prompts + +Foot can move the current viewport to focus prompts of already executed +commands (bound to ctrl+shift+z/x by default). + +## Piping last command's output + +The key binding `pipe-command-output` can pipe the last command's output to an +application of your choice (similar to the other `pipe-*` key bindings): + +``` +[key-bindings] +pipe-command-output=[sh -c "f=$(mktemp); cat - > $f; footclient emacsclient -nw $f; rm $f"] Control+Shift+g +``` + +When pressing ctrl+shift+g, the last command's output is written to a +temporary file, then an emacsclient is started in a new footclient instance. +The temporary file is removed after the footclient instance has closed. + diff --git a/plugins/foot/foot.plugin.zsh b/plugins/foot/foot.plugin.zsh new file mode 100644 index 000000000..c1d077e26 --- /dev/null +++ b/plugins/foot/foot.plugin.zsh @@ -0,0 +1,10 @@ +function precmd { + print -Pn "\e]133;A\e\\" + if ! builtin zle; then + print -n "\e]133;D\e\\" + fi +} + +function preexec { + print -n "\e]133;C\e\\" +} From d2e79501b252ffafa2a25b541f67332c3e186807 Mon Sep 17 00:00:00 2001 From: shun095 <8069181+shun095@users.noreply.github.com> Date: Fri, 24 Jan 2025 05:04:45 +0900 Subject: [PATCH 16/62] fix(timer): minutes calculation logic (#12857) --- plugins/timer/timer.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/timer/timer.plugin.zsh b/plugins/timer/timer.plugin.zsh index d21d59989..6baf1f681 100644 --- a/plugins/timer/timer.plugin.zsh +++ b/plugins/timer/timer.plugin.zsh @@ -6,7 +6,7 @@ __timer_current_time() { } __timer_format_duration() { - local mins=$(printf '%.0f' $(($1 / 60))) + local mins=$(printf '%.0f' $(($(IFS='.' read int dec <<< "$1"; echo $int) / 60))) local secs=$(printf "%.${TIMER_PRECISION:-1}f" $(($1 - 60 * mins))) local duration_str=$(echo "${mins}m${secs}s") local format="${TIMER_FORMAT:-/%d}" From 85c49414926ad86f76d7bad3635f948bb5f883cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 23 Jan 2025 21:06:00 +0100 Subject: [PATCH 17/62] fix(cli)!: remove harmful `--unattended` flag for `omz update` (#12935) Co-authored-by: Carlo Sala --- README.md | 11 +++++++++++ lib/cli.zsh | 15 +++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 58828cf7f..f7455228a 100644 --- a/README.md +++ b/README.md @@ -487,6 +487,17 @@ wait a week?) you just need to run: omz update ``` +> [!NOTE] +> If you want to automate this process in a script, you should call directly the `upgrade` script, like this: +> +> ```sh +> $ZSH/tools/upgrade.sh +> ``` +> +> See more options in the [FAQ: How do I update Oh My Zsh?](https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-update-oh-my-zsh). +> +> **USE OF `omz update --unattended` HAS BEEN REMOVED, AS IT HAS SIDE EFFECTS**. + Magic! 🎉 ## Uninstalling Oh My Zsh diff --git a/lib/cli.zsh b/lib/cli.zsh index c63185a3d..aed86e758 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -823,6 +823,13 @@ function _omz::update { return 1 } + # Check if --unattended was passed + [[ "$1" != --unattended ]] || { + _omz::log error "the \`\e[2m--unattended\e[0m\` flag is no longer supported, use the \`\e[2mupgrade.sh\e[0m\` script instead." + _omz::log error "for more information see https://github.com/ohmyzsh/ohmyzsh/wiki/FAQ#how-do-i-update-oh-my-zsh" + return 1 + } + local last_commit=$(builtin cd -q "$ZSH"; git rev-parse HEAD 2>/dev/null) [[ $? -eq 0 ]] || { _omz::log error "\`$ZSH\` is not a git directory. Aborting..." @@ -831,11 +838,7 @@ function _omz::update { # Run update script zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default - if [[ "$1" != --unattended ]]; then - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $? - else - ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -v $verbose_mode || return $? - fi + ZSH="$ZSH" command zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode || return $? # Update last updated file zmodload zsh/datetime @@ -844,7 +847,7 @@ function _omz::update { command rm -rf "$ZSH/log/update.lock" # Restart the zsh session if there were changes - if [[ "$1" != --unattended && "$(builtin cd -q "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then + if [[ "$(builtin cd -q "$ZSH"; git rev-parse HEAD)" != "$last_commit" ]]; then # Old zsh versions don't have ZSH_ARGZERO local zsh="${ZSH_ARGZERO:-${functrace[-1]%:*}}" # Check whether to run a login shell From 5fd2059e5eda17ee07501a21d47189d4b96d6ff3 Mon Sep 17 00:00:00 2001 From: Ken van der Eerden <15888558+Ken-vdE@users.noreply.github.com> Date: Thu, 23 Jan 2025 21:08:55 +0100 Subject: [PATCH 18/62] feat(jira): allow branch name customization (#12850) Co-authored-by: Carlo Sala --- plugins/jira/README.md | 16 ++++++++++++++ plugins/jira/jira.plugin.zsh | 43 +++++++++++++++++++++--------------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index 7cfb81b19..19266e7f0 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -43,6 +43,22 @@ starting with "_": "MP-1234_fix_dashboard". In both these cases, the issue opene This is also checks if the prefix is in the name, and adds it if not, so: "MP-1234" opens the issue "MP-1234", "mp-1234" opens the issue "mp-1234", and "1234" opens the issue "MP-1234". +If your branch naming convention deviates, you can overwrite the jira_branch function to determine and echo the Jira issue key yourself. +Define a function `jira_branch` after sourcing `oh-my-zsh.sh` in your `.zshrc`. +Example: +```zsh +# Determine branch name from naming convention 'type/KEY-123/description'. +function jira_branch() { + # Get name of the branch + issue_arg=$(git rev-parse --abbrev-ref HEAD) + # Strip prefixes like feature/ or bugfix/ + issue_arg=${issue_arg#*/} + # Strip suffixes like /some-branch-description + issue_arg=${issue_arg%%/*} + # Return the value + echo $issue_arg +} +``` #### Debugging usage diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 9bcf4cc7b..22e0c82c7 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -17,6 +17,30 @@ jira branch Opens an existing issue matching the current bra EOF } +# If your branch naming convention deviates, you can partially override this plugin function +# to determine the jira issue key based on your formatting. +# See https://github.com/ohmyzsh/ohmyzsh/wiki/Customization#partially-overriding-an-existing-plugin +function jira_branch() { + # Get name of the branch + issue_arg=$(git rev-parse --abbrev-ref HEAD) + # Strip prefixes like feature/ or bugfix/ + issue_arg=${issue_arg##*/} + # Strip suffixes starting with _ + issue_arg=(${(s:_:)issue_arg}) + # If there is only one part, it means that there is a different delimiter. Try with - + if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then + issue_arg=(${(s:-:)issue_arg}) + issue_arg="${issue_arg[1]}-${issue_arg[2]}" + else + issue_arg=${issue_arg[1]} + fi + if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then + echo "${issue_arg}" + else + echo "${jira_prefix}${issue_arg}" + fi +} + function jira() { emulate -L zsh local action jira_url jira_prefix @@ -91,24 +115,7 @@ function jira() { # but `branch` is a special case that will parse the current git branch local issue_arg issue if [[ "$action" == "branch" ]]; then - # Get name of the branch - issue_arg=$(git rev-parse --abbrev-ref HEAD) - # Strip prefixes like feature/ or bugfix/ - issue_arg=${issue_arg##*/} - # Strip suffixes starting with _ - issue_arg=(${(s:_:)issue_arg}) - # If there is only one part, it means that there is a different delimiter. Try with - - if [[ ${#issue_arg[@]} = 1 && ${issue_arg} == *-* ]]; then - issue_arg=(${(s:-:)issue_arg}) - issue_arg="${issue_arg[1]}-${issue_arg[2]}" - else - issue_arg=${issue_arg[1]} - fi - if [[ "${issue_arg:l}" = ${jira_prefix:l}* ]]; then - issue="${issue_arg}" - else - issue="${jira_prefix}${issue_arg}" - fi + issue=$(jira_branch) else issue_arg=${(U)action} issue="${jira_prefix}${issue_arg}" From 3bd48b12c8047a12986c79b825ea2451fe5f0ddb Mon Sep 17 00:00:00 2001 From: Eduardo Roberto Date: Fri, 24 Jan 2025 20:39:17 +0000 Subject: [PATCH 19/62] chore: ignore `.zwc` files (#12936) --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 10bd4bebc..a53da3b3e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ log/ # editor configs .vscode .idea + +# zcompile cached files +*.zwc From cc9259d6ad6b1d3cab488cc02f705be1c840c785 Mon Sep 17 00:00:00 2001 From: Marcus Voltolim <9442331+marcusvoltolim@users.noreply.github.com> Date: Fri, 24 Jan 2025 17:40:58 -0300 Subject: [PATCH 20/62] docs(git-auto-fetch): fix typo (#12937) --- plugins/git-auto-fetch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git-auto-fetch/README.md b/plugins/git-auto-fetch/README.md index e96ab42a3..0d7431bba 100644 --- a/plugins/git-auto-fetch/README.md +++ b/plugins/git-auto-fetch/README.md @@ -18,7 +18,7 @@ You can change the fetch interval in your .zshrc: GIT_AUTO_FETCH_INTERVAL=1200 # in seconds ``` -A log of `git fetch --all` will be saved in `.git/FETCH_LOG`. +A log of `git-fetch-all` will be saved in `.git/FETCH_LOG`. ## Toggle auto-fetch per folder From 9ffc14c3e1de2054fa113e2c7d42cbdac542769b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 26 Jan 2025 14:11:35 +0100 Subject: [PATCH 21/62] chore(deps): bump semver from 3.0.3 to 3.0.4 in /.github/workflows/dependencies (#12938) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index d8149743c..0471ccc4a 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -3,5 +3,5 @@ charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 requests==2.32.3 -semver==3.0.3 +semver==3.0.4 urllib3==2.3.0 From ce9a4a0196a372b153a592ecd61b728cd88bb767 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sun, 26 Jan 2025 14:21:14 +0100 Subject: [PATCH 22/62] feat(dnf): add `dnf5` completion Closes #12939 --- plugins/dnf/_dnf5 | 570 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 570 insertions(+) create mode 100644 plugins/dnf/_dnf5 diff --git a/plugins/dnf/_dnf5 b/plugins/dnf/_dnf5 new file mode 100644 index 000000000..e194dd5a7 --- /dev/null +++ b/plugins/dnf/_dnf5 @@ -0,0 +1,570 @@ +#compdef dnf5 +# based on dnf-5.2.6.2 + +# utility functions + +_dnf5_helper() { + _call_program specs $service "${(q-)@}" "${(q-)PREFIX}\*" \ + -qC --assumeno --nogpgcheck 2>/dev/null command' '*:: :->cmd_args' && ret=0 + + case $state in + command) _dnf5_commands && ret=0 ;; + cmd_args) _dnf5_subcmds_opts && ret=0 ;; + esac + return ret +} + +_dnf5 "$@" From 33d4db7feeacaf82c8e277555010cd6f5d9f1c7c Mon Sep 17 00:00:00 2001 From: Guspan Tanadi <36249910+guspan-tanadi@users.noreply.github.com> Date: Wed, 29 Jan 2025 20:59:04 +0700 Subject: [PATCH 23/62] docs(ember-cli): fix typo (#12945) --- plugins/ember-cli/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ember-cli/README.md b/plugins/ember-cli/README.md index 419704ade..1532eea9c 100644 --- a/plugins/ember-cli/README.md +++ b/plugins/ember-cli/README.md @@ -29,5 +29,5 @@ plugins=(... ember-cli) - [BilalBudhani](https://github.com/BilalBudhani) - [eubenesa](https://github.com/eubenesa) -- [scottkidder](https://github.com/scottkidder] +- [scottkidder](https://github.com/scottkidder) - [t-sauer](https://www.github.com/t-sauer) From 1c34b0e67d4f1dff36a079f31d7dafe8bcf92f6e Mon Sep 17 00:00:00 2001 From: soemiran Date: Thu, 30 Jan 2025 16:14:04 +0100 Subject: [PATCH 24/62] feat(terraform): support `TF_DATA_DIR` in `tf_prompt_info` (#12949) --- plugins/terraform/terraform.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index 1c1d1b37e..046fabb03 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -2,9 +2,9 @@ function tf_prompt_info() { # dont show 'default' workspace in home dir [[ "$PWD" != ~ ]] || return # check if in terraform dir and file exists - [[ -d .terraform && -r .terraform/environment ]] || return + [[ -d "${TF_DATA_DIR:-.terraform}" && -r "${TF_DATA_DIR:-.terraform}/environment" ]] || return - local workspace="$(< .terraform/environment)" + local workspace="$(< "${TF_DATA_DIR:-.terraform}/environment")" echo "${ZSH_THEME_TF_PROMPT_PREFIX-[}${workspace:gs/%/%%}${ZSH_THEME_TF_PROMPT_SUFFIX-]}" } From 2343ad517d3439877e85c03846a38e4b3bf6d984 Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 07:50:33 +0100 Subject: [PATCH 25/62] feat(wd): update to v0.9.3 (#12954) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/wd.sh | 53 ++++++++++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 02995d6cd..46e7727b8 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -30,7 +30,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.9.2 + version: tag:v0.9.3 precopy: | set -e rm -r test diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index 962ad9afa..f8b27828f 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.9.2 +readonly WD_VERSION=0.9.3 # colors readonly WD_BLUE="\033[96m" @@ -256,20 +256,47 @@ wd_remove() } wd_browse() { + # Check if fzf is installed if ! command -v fzf >/dev/null; then - echo "This functionality requires fzf. Please install fzf first." + wd_print_msg "$WD_RED" "This functionality requires fzf. Please install fzf first." return 1 fi + + # Ensure wd_config_file is properly set + if [[ -z $wd_config_file ]]; then + wd_config_file="${WD_CONFIG:-$HOME/.warprc}" + fi + + # Check if config file exists + if [[ ! -f $wd_config_file ]]; then + wd_print_msg "$WD_RED" "Config file $wd_config_file does not exist. Please create it first." + return 1 + fi + + # Read entries from the config file local entries=("${(@f)$(sed "s:${HOME}:~:g" "$wd_config_file" | awk -F ':' '{print $1 " -> " $2}')}") + if [[ -z $entries ]]; then + wd_print_msg "$WD_YELLOW" "You don't have any warp points to browse" + return 1 + fi + + # Temp file for remove operations local script_path="${${(%):-%x}:h}" local wd_remove_output=$(mktemp "${TMPDIR:-/tmp}/wd.XXXXXXXXXX") + + # Create fzf bindings entries=("All warp points:" "Press enter to select. Press delete to remove" "${entries[@]}") - local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} "$script_path/wd.sh" rm {} > "$wd_remove_output")+abort" + local fzf_bind="delete:execute(echo {} | awk -F ' -> ' '{print \$1}' | xargs -I {} \"$script_path/wd.sh\" rm {} > \"$wd_remove_output\")+abort" + + # Run fzf local selected_entry=$(printf '%s\n' "${entries[@]}" | fzf --height 100% --reverse --header-lines=2 --bind="$fzf_bind") + + # Handle selection if [[ -e $wd_remove_output ]]; then cat "$wd_remove_output" - rm "$wd_remove_output" + rm -f "$wd_remove_output" fi + if [[ -n $selected_entry ]]; then local selected_point="${selected_entry%% ->*}" selected_point=$(echo "$selected_point" | xargs) @@ -278,14 +305,26 @@ wd_browse() { } wd_browse_widget() { - if [[ -e $wd_config_file ]]; then + # Ensure wd_config_file is properly set + if [[ -z $wd_config_file ]]; then + wd_config_file="${WD_CONFIG:-$HOME/.warprc}" + fi + + # Check if config file exists + if [[ ! -f $wd_config_file ]]; then + wd_print_msg "$WD_RED" "Config file $wd_config_file does not exist. Please create it first." + return 1 + fi + + # Call wd_browse to handle the selection wd_browse + + # Restore the zsh buffer and cursor after running wd_browse saved_buffer=$BUFFER saved_cursor=$CURSOR BUFFER= zle redisplay zle accept-line - fi } wd_restore_buffer() { @@ -578,7 +617,7 @@ unset wd_print_msg unset wd_yesorno unset wd_print_usage unset wd_alt_config -unset wd_config_file +#unset wd_config_file do not unset this - breaks keybind unset wd_quiet_mode unset wd_print_version unset wd_force_mode From 2b547d113b7e55a556b695c9372f1beb721efd67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 2 Feb 2025 13:38:22 +0100 Subject: [PATCH 26/62] chore(deps): bump certifi in /.github/workflows/dependencies (#12955) Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.12.14 to 2025.1.31. - [Commits](https://github.com/certifi/python-certifi/compare/2024.12.14...2025.01.31) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 0471ccc4a..910db7bac 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2024.12.14 +certifi==2025.1.31 charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 From db32c6ccce91e0b36873c8bfccd1e40f452a2060 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Tue, 4 Feb 2025 13:37:02 +0100 Subject: [PATCH 27/62] fix(mvn): handle directories in `` (#12957) --- plugins/mvn/mvn.plugin.zsh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index a569a87fa..7bffce36e 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -101,8 +101,14 @@ function listMavenCompletions { new_file="../pom.xml" fi - # if file doesn't exist break file="${file:h}/${new_file}" + + # if the file points to a directory, assume it is a pom.xml in that directory + if [[ -d "$file" ]]; then + file="${file}/pom.xml" + fi + + # if file doesn't exist break if ! [[ -e "$file" ]]; then break fi From 4d9d346718caa6efdf6f350ed803e70d34fc6577 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 12 Feb 2025 20:15:25 +0100 Subject: [PATCH 28/62] feat(asdf): support asdf v0.16 ahead Co-authored-by: Valgard Trontheim Closes #12964 Closes #12967 --- plugins/asdf/asdf.plugin.zsh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 7635d20c3..4367e8ca3 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,3 +1,21 @@ +if (( $+commands[asdf] )); then + export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" + path=("$ASDF_DATA_DIR/shims" $path) + + # If the completion file doesn't exist yet, we need to autoload it and + # bind it to `asdf`. Otherwise, compinit will have already done that. + if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then + typeset -g -A _comps + autoload -Uz _asdf + _comps[asdf]=_asdf + fi + asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| + + return +fi + +# TODO:(2025-02-12): remove deprecated asdf <0.16 code + # Find where asdf should be installed ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" ASDF_COMPLETIONS="$ASDF_DIR/completions" From 8074eb8b46d20a2f3ad2b99201388900a2e33450 Mon Sep 17 00:00:00 2001 From: Dennis Dashkevich Date: Wed, 12 Feb 2025 22:24:56 +0300 Subject: [PATCH 29/62] fix(chruby): update brew sourcing for Apple Silicon (#12941) Co-authored-by: Carlo Sala --- plugins/chruby/chruby.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/chruby/chruby.plugin.zsh b/plugins/chruby/chruby.plugin.zsh index 1210897c4..06afef189 100644 --- a/plugins/chruby/chruby.plugin.zsh +++ b/plugins/chruby/chruby.plugin.zsh @@ -22,6 +22,8 @@ _source-from-homebrew() { # check default brew prefix if [[ -h /usr/local/opt/chruby ]];then _brew_prefix="/usr/local/opt/chruby" + elif [[ -h /opt/homebrew/opt/chruby ]]; then + _brew_prefix="/opt/homebrew/opt/chruby" else # ok , it is not default prefix # this call to brew is expensive ( about 400 ms ), so at least let's make it only once From 0e99f402cd5a335042559396ae300a7668bac933 Mon Sep 17 00:00:00 2001 From: Stephen Gelman Date: Wed, 12 Feb 2025 13:33:35 -0600 Subject: [PATCH 30/62] feat(agnoster): add color config and add some git stuff (#12505) Co-authored-by: Kilobyte22 Co-authored-by: Carlo Sala --- themes/agnoster.zsh-theme | 147 ++++++++++++++++++++++++++++++-------- 1 file changed, 118 insertions(+), 29 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c2a542163..67db2cf46 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -39,6 +39,63 @@ case ${SOLARIZED_THEME:-dark} in *) CURRENT_FG='black';; esac +### Theme Configuration Initialization +# +# Override these settings in your ~/.zshrc + +# Current working directory +: ${AGNOSTER_DIR_FG:=${CURRENT_FG}} +: ${AGNOSTER_DIR_BG:=blue} + +# user@host +: ${AGNOSTER_CONTEXT_FG:=default} +: ${AGNOSTER_CONTEXT_BG:=black} + +# Git related +: ${AGNOSTER_GIT_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_GIT_CLEAN_BG:=green} +: ${AGNOSTER_GIT_DIRTY_FG:=black} +: ${AGNOSTER_GIT_DIRTY_BG:=yellow} + +# Bazaar related +: ${AGNOSTER_BZR_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_BZR_CLEAN_BG:=green} +: ${AGNOSTER_BZR_DIRTY_FG:=black} +: ${AGNOSTER_BZR_DIRTY_BG:=yellow} + +# Mercurial related +: ${AGNOSTER_HG_NEWFILE_FG:=white} +: ${AGNOSTER_HG_NEWFILE_BG:=red} +: ${AGNOSTER_HG_CHANGED_FG:=black} +: ${AGNOSTER_HG_CHANGED_BG:=yellow} +: ${AGNOSTER_HG_CLEAN_FG:=${CURRENT_FG}} +: ${AGNOSTER_HG_CLEAN_BG:=green} + +# VirtualEnv colors +: ${AGNOSTER_VENV_FG:=black} +: ${AGNOSTER_VENV_BG:=blue} + +# AWS Profile colors +: ${AGNOSTER_AWS_PROD_FG:=yellow} +: ${AGNOSTER_AWS_PROD_BG:=red} +: ${AGNOSTER_AWS_FG:=black} +: ${AGNOSTER_AWS_BG:=green} + +# Status symbols +: ${AGNOSTER_STATUS_RETVAL_FG:=red} +: ${AGNOSTER_STATUS_ROOT_FG:=yellow} +: ${AGNOSTER_STATUS_JOB_FG:=cyan} +: ${AGNOSTER_STATUS_BG:=black} + +## Non-Color settings - set to 'true' to enable +# Show the actual numeric return value rather than a cross symbol. +: ${AGNOSTER_STATUS_RETVAL_NUMERIC:=false} +# Show git working dir in the style "/git/root   master  relative/dir" instead of "/git/root/relative/dir   master" +: ${AGNOSTER_GIT_INLINE:=false} +# Show the git branch status in the prompt rather than the generic branch symbol +: ${AGNOSTER_GIT_BRANCH_STATUS:=true} + + # Special Powerline characters () { @@ -83,16 +140,36 @@ prompt_end() { CURRENT_BG='' } +git_toplevel() { + local repo_root=$(git rev-parse --show-toplevel) + if [[ $repo_root = '' ]]; then + # We are in a bare repo. Use git dir as root + repo_root=$(git rev-parse --git-dir) + if [[ $repo_root = '.' ]]; then + repo_root=$PWD + fi + fi + echo -n $repo_root +} + ### Prompt components # Each component will draw itself, and hide itself if no information needs to be shown # Context: user@hostname (who am I and where am I) prompt_context() { if [[ "$USERNAME" != "$DEFAULT_USER" || -n "$SSH_CLIENT" ]]; then - prompt_segment black default "%(!.%{%F{yellow}%}.)%n@%m" + prompt_segment "$AGNOSTER_CONTEXT_BG" "$AGNOSTER_CONTEXT_FG" "%(!.%{%F{$AGNOSTER_STATUS_ROOT_FG}%}.)%n@%m" fi } +prompt_git_relative() { + local repo_root=$(git_toplevel) + local path_in_repo=$(pwd | sed "s/^$(echo "$repo_root" | sed 's:/:\\/:g;s/\$/\\$/g')//;s:^/::;s:/$::;") + if [[ $path_in_repo != '' ]]; then + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" "$path_in_repo" + fi; +} + # Git: branch/detached head, dirty status prompt_git() { (( $+commands[git] )) || return @@ -113,20 +190,22 @@ prompt_git() { ref="◈ $(command git describe --exact-match --tags HEAD 2> /dev/null)" || \ ref="➦ $(command git rev-parse --short HEAD 2> /dev/null)" if [[ -n $dirty ]]; then - prompt_segment yellow black + prompt_segment "$AGNOSTER_GIT_DIRTY_BG" "$AGNOSTER_GIT_DIRTY_FG" else - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_GIT_CLEAN_BG" "$AGNOSTER_GIT_CLEAN_FG" fi - local ahead behind - ahead=$(command git log --oneline @{upstream}.. 2>/dev/null) - behind=$(command git log --oneline ..@{upstream} 2>/dev/null) - if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then - PL_BRANCH_CHAR=$'\u21c5' - elif [[ -n "$ahead" ]]; then - PL_BRANCH_CHAR=$'\u21b1' - elif [[ -n "$behind" ]]; then - PL_BRANCH_CHAR=$'\u21b0' + if [[ $AGNOSTER_GIT_BRANCH_STATUS == 'true' ]]; then + local ahead behind + ahead=$(command git log --oneline @{upstream}.. 2>/dev/null) + behind=$(command git log --oneline ..@{upstream} 2>/dev/null) + if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then + PL_BRANCH_CHAR=$'\u21c5' + elif [[ -n "$ahead" ]]; then + PL_BRANCH_CHAR=$'\u21b1' + elif [[ -n "$behind" ]]; then + PL_BRANCH_CHAR=$'\u21b0' + fi fi if [[ -e "${repo_path}/BISECT_LOG" ]]; then @@ -149,6 +228,7 @@ prompt_git() { zstyle ':vcs_info:*' actionformats ' %u%c' vcs_info echo -n "${${ref:gs/%/%%}/refs\/heads\//$PL_BRANCH_CHAR }${vcs_info_msg_0_%% }${mode}" + [[ $AGNOSTER_GIT_INLINE == 'true' ]] && prompt_git_relative fi } @@ -168,12 +248,12 @@ prompt_bzr() { status_all=$(echo -n "$bzr_status" | head -n1 | wc -m) revision=${$(command bzr log -r-1 --log-format line | cut -d: -f1):gs/%/%%} if [[ $status_mod -gt 0 ]] ; then - prompt_segment yellow black "bzr@$revision ✚" + prompt_segment "$AGNOSTER_BZR_DIRTY_BG" "$AGNOSTER_BZR_DIRTY_FG" "bzr@$revision ✚" else if [[ $status_all -gt 0 ]] ; then - prompt_segment yellow black "bzr@$revision" + prompt_segment "$AGNOSTER_BZR_DIRTY_BG" "$AGNOSTER_BZR_DIRTY_FG" "bzr@$revision" else - prompt_segment green black "bzr@$revision" + prompt_segment "$AGNOSTER_BZR_CLEAN_BG" "$AGNOSTER_BZR_CLEAN_FG" "bzr@$revision" fi fi fi @@ -186,15 +266,15 @@ prompt_hg() { if $(command hg prompt >/dev/null 2>&1); then if [[ $(command hg prompt "{status|unknown}") = "?" ]]; then # if files are not added - prompt_segment red white + prompt_segment "$AGNOSTER_HG_NEWFILE_BG" "$AGNOSTER_HG_NEWFILE_FG" st='±' elif [[ -n $(command hg prompt "{status|modified}") ]]; then # if any modification - prompt_segment yellow black + prompt_segment "$AGNOSTER_HG_CHANGED_BG" "$AGNOSTER_HG_CHANGED_FG" st='±' else # if working copy is clean - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_HG_CLEAN_BG" "$AGNOSTER_HG_CLEAN_FG" fi echo -n ${$(command hg prompt "☿ {rev}@{branch}"):gs/%/%%} $st else @@ -202,13 +282,13 @@ prompt_hg() { rev=$(command hg id -n 2>/dev/null | sed 's/[^-0-9]//g') branch=$(command hg id -b 2>/dev/null) if command hg st | command grep -q "^\?"; then - prompt_segment red black + prompt_segment "$AGNOSTER_HG_NEWFILE_BG" "$AGNOSTER_HG_NEWFILE_FG" st='±' elif command hg st | command grep -q "^[MA]"; then - prompt_segment yellow black + prompt_segment "$AGNOSTER_HG_CHANGED_BG" "$AGNOSTER_HG_CHANGED_FG" st='±' else - prompt_segment green $CURRENT_FG + prompt_segment "$AGNOSTER_HG_CLEAN_BG" "$AGNOSTER_HG_CLEAN_FG" fi echo -n "☿ ${rev:gs/%/%%}@${branch:gs/%/%%}" $st fi @@ -217,13 +297,18 @@ prompt_hg() { # Dir: current working directory prompt_dir() { - prompt_segment blue $CURRENT_FG '%~' + if [[ $AGNOSTER_GIT_INLINE == 'true' ]] && $(git rev-parse --is-inside-work-tree >/dev/null 2>&1); then + # Git repo and inline path enabled, hence only show the git root + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" "$(git_toplevel | sed "s:^$HOME:~:")" + else + prompt_segment "$AGNOSTER_DIR_BG" "$AGNOSTER_DIR_FG" '%~' + fi } # Virtualenv: current working virtualenv prompt_virtualenv() { if [[ -n "$VIRTUAL_ENV" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then - prompt_segment blue black "(${VIRTUAL_ENV:t:gs/%/%%})" + prompt_segment "$AGNOSTER_VENV_BG" "$AGNOSTER_VENV_FG" "(${VIRTUAL_ENV:t:gs/%/%%})" fi } @@ -234,11 +319,15 @@ prompt_virtualenv() { prompt_status() { local -a symbols - [[ $RETVAL -ne 0 ]] && symbols+="%{%F{red}%}✘" - [[ $UID -eq 0 ]] && symbols+="%{%F{yellow}%}⚡" - [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{cyan}%}⚙" + if [[ $AGNOSTER_STATUS_RETVAL_NUMERIC == 'true' ]]; then + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_RETVAL_FG}%}$RETVAL" + else + [[ $RETVAL -ne 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_RETVAL_FG}%}✘" + fi + [[ $UID -eq 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_ROOT_FG}%}⚡" + [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙" - [[ -n "$symbols" ]] && prompt_segment black default "$symbols" + [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" default "$symbols" } #AWS Profile: @@ -249,8 +338,8 @@ prompt_status() { prompt_aws() { [[ -z "$AWS_PROFILE" || "$SHOW_AWS_PROMPT" = false ]] && return case "$AWS_PROFILE" in - *-prod|*production*) prompt_segment red yellow "AWS: ${AWS_PROFILE:gs/%/%%}" ;; - *) prompt_segment green black "AWS: ${AWS_PROFILE:gs/%/%%}" ;; + *-prod|*production*) prompt_segment "$AGNOSTER_AWS_PROD_BG" "$AGNOSTER_AWS_PROD_FG" "AWS: ${AWS_PROFILE:gs/%/%%}" ;; + *) prompt_segment "$AGNOSTER_AWS_BG" "$AGNOSTER_AWS_FG" "AWS: ${AWS_PROFILE:gs/%/%%}" ;; esac } From 7d32e7fc3fb56032252548a690744a26c3ac3059 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 13 Feb 2025 12:22:23 +0100 Subject: [PATCH 31/62] fix(updater): detect p10k instant prompt (#12971) Fixes #12781 --- tools/check_for_upgrade.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/check_for_upgrade.sh b/tools/check_for_upgrade.sh index 1ecab5c0b..35391ea70 100644 --- a/tools/check_for_upgrade.sh +++ b/tools/check_for_upgrade.sh @@ -27,7 +27,7 @@ zstyle -s ':omz:update' mode update_mode || { # - $ZSH is not a git repository if [[ "$update_mode" = disabled ]] \ || [[ ! -w "$ZSH" || ! -O "$ZSH" ]] \ - || [[ ! -t 1 ]] \ + || [[ ! -t 1 && ${POWERLEVEL9K_INSTANT_PROMPT:-off} == off ]] \ || ! command git --version 2>&1 >/dev/null \ || (builtin cd -q "$ZSH"; ! command git rev-parse --is-inside-work-tree &>/dev/null); then unset update_mode @@ -112,6 +112,11 @@ function update_ohmyzsh() { local verbose_mode zstyle -s ':omz:update' verbose verbose_mode || verbose_mode=default + # Force verbose mode to silent if p10k instant prompt is enabled + if [[ ${POWERLEVEL9K_INSTANT_PROMPT:-off} != "off" ]]; then + verbose_mode=silent + fi + if [[ "$update_mode" != background-alpha ]] \ && LANG= ZSH="$ZSH" zsh -f "$ZSH/tools/upgrade.sh" -i -v $verbose_mode; then update_last_updated_file From 92da3108b52be506dc1334e8f0dc67c5d1c13d57 Mon Sep 17 00:00:00 2001 From: Adrien Plazas Date: Fri, 14 Feb 2025 10:18:01 +0100 Subject: [PATCH 32/62] fix(agnoster): print white text over black (#12525) --- themes/agnoster.zsh-theme | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 67db2cf46..b48bac56a 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -48,7 +48,7 @@ esac : ${AGNOSTER_DIR_BG:=blue} # user@host -: ${AGNOSTER_CONTEXT_FG:=default} +: ${AGNOSTER_CONTEXT_FG:=white} : ${AGNOSTER_CONTEXT_BG:=black} # Git related @@ -85,6 +85,7 @@ esac : ${AGNOSTER_STATUS_RETVAL_FG:=red} : ${AGNOSTER_STATUS_ROOT_FG:=yellow} : ${AGNOSTER_STATUS_JOB_FG:=cyan} +: ${AGNOSTER_STATUS_FG:=white} : ${AGNOSTER_STATUS_BG:=black} ## Non-Color settings - set to 'true' to enable @@ -327,7 +328,7 @@ prompt_status() { [[ $UID -eq 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_ROOT_FG}%}⚡" [[ $(jobs -l | wc -l) -gt 0 ]] && symbols+="%{%F{$AGNOSTER_STATUS_JOB_FG}%}⚙" - [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" default "$symbols" + [[ -n "$symbols" ]] && prompt_segment "$AGNOSTER_STATUS_BG" "$AGNOSTER_STATUS_FG" "$symbols" } #AWS Profile: From 6e7ac0544e71c7b777746cb50f70de68c6495b86 Mon Sep 17 00:00:00 2001 From: tuzi3040 <28290621+tuzi3040@users.noreply.github.com> Date: Wed, 19 Feb 2025 19:37:18 +0800 Subject: [PATCH 33/62] fix(agnoster): print white text over black for light theme only (#12983) --- themes/agnoster.zsh-theme | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index b48bac56a..adeffe8c2 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -35,8 +35,14 @@ CURRENT_BG='NONE' case ${SOLARIZED_THEME:-dark} in - light) CURRENT_FG='white';; - *) CURRENT_FG='black';; + light) + CURRENT_FG='white' + CURRENT_DEFAULT_FG='white' + ;; + *) + CURRENT_FG='black' + CURRENT_DEFAULT_FG='default' + ;; esac ### Theme Configuration Initialization @@ -48,7 +54,7 @@ esac : ${AGNOSTER_DIR_BG:=blue} # user@host -: ${AGNOSTER_CONTEXT_FG:=white} +: ${AGNOSTER_CONTEXT_FG:=${CURRENT_DEFAULT_FG}} : ${AGNOSTER_CONTEXT_BG:=black} # Git related @@ -85,7 +91,7 @@ esac : ${AGNOSTER_STATUS_RETVAL_FG:=red} : ${AGNOSTER_STATUS_ROOT_FG:=yellow} : ${AGNOSTER_STATUS_JOB_FG:=cyan} -: ${AGNOSTER_STATUS_FG:=white} +: ${AGNOSTER_STATUS_FG:=${CURRENT_DEFAULT_FG}} : ${AGNOSTER_STATUS_BG:=black} ## Non-Color settings - set to 'true' to enable From 30e516a3aa47d90b5f507d5ddacb1b9b69567975 Mon Sep 17 00:00:00 2001 From: nasso <11479594+nasso@users.noreply.github.com> Date: Mon, 3 Mar 2025 17:15:43 +0100 Subject: [PATCH 34/62] feat(jj): add jujutsu plugin (#12292) --- plugins/jj/README.md | 89 ++++++++++++++++++++++++++++++++++++++++ plugins/jj/jj.plugin.zsh | 53 ++++++++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 plugins/jj/README.md create mode 100644 plugins/jj/jj.plugin.zsh diff --git a/plugins/jj/README.md b/plugins/jj/README.md new file mode 100644 index 000000000..cd43ed11b --- /dev/null +++ b/plugins/jj/README.md @@ -0,0 +1,89 @@ +# jj - Jujutsu CLI + +This plugin provides autocompletion for [jj](https://martinvonz.github.io/jj). + +To use it, add `jj` to the plugins array of your zshrc file: + +```zsh +plugins=(... jj) +``` + +## Aliases + +| Alias | Command | +| ------ | ----------------------------- | +| jjc | `jj commit` | +| jjcmsg | `jj commit --message` | +| jjd | `jj diff` | +| jjdmsg | `jj desc --message` | +| jjds | `jj desc` | +| jje | `jj edit` | +| jjgcl | `jj git clone` | +| jjgf | `jj git fetch` | +| jjgp | `jj git push` | +| jjl | `jj log` | +| jjla | `jj log -r "all()"` | +| jjn | `jj new` | +| jjrb | `jj rebase` | +| jjrs | `jj restore` | +| jjrt | `cd "$(jj root \|\| echo .)"` | +| jjsp | `jj split` | +| jjsq | `jj squash` | + +## Prompt usage + +Because `jj` has a very powerful [template syntax](https://martinvonz.github.io/jj/latest/templates/), this +plugin only exposes a convenience function `jj_prompt_template` to read information from the current change. +It is basically the same as `jj log --no-graph -r @ -T $1`: + +```sh +_my_theme_jj_info() { + jj_prompt_template 'self.change_id().shortest(3)' +} + +PROMPT='$(_my_theme_jj_info) $' +``` + +`jj_prompt_template` escapes `%` signs in the output. Use `jj_prompt_template_raw` if you don't want that +(e.g. to colorize the output). + +However, because `jj` can be used inside a Git repository, some themes might clash with it. Generally, you can +fix it with a wrapper function that tries `jj` first and then falls back to `git` if it didn't work: + +```sh +_my_theme_vcs_info() { + jj_prompt_template 'self.change_id().shortest(3)' \ + || git_prompt_info +} + +PROMPT='$(_my_theme_vcs_info) $' +``` + +You can find an example +[here](https://github.com/nasso/omzsh/blob/e439e494f22f4fd4ef1b6cb64626255f4b341c1b/themes/sunakayu.zsh-theme). + +### Performance + +Sometimes `jj` can be slower than `git`. + +If you feel slowdowns, consider using the following: + +``` +zstyle :omz:plugins:jj ignore-working-copy yes +``` + +This will add `--ignore-working-copy` to all `jj` commands executed by your prompt. The downside here is that +your prompt might be out-of-sync until the next time `jj` gets a chance to _not_ ignore the working copy (i.e. +you manually run a `jj` command). + +If you prefer to keep your prompt always up-to-date but still don't want to _feel_ the slowdown, you can make +your prompt asynchronous. This plugin doesn't do this automatically so you'd have to hack your theme a bit for +that. + +## See Also + +- [martinvonz/jj](https://github.com/martinvonz/jj) + +## Contributors + +- [nasso](https://github.com/nasso) - Plugin Author diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh new file mode 100644 index 000000000..9f683923d --- /dev/null +++ b/plugins/jj/jj.plugin.zsh @@ -0,0 +1,53 @@ +# if jj is not found, don't do the rest of the script +if (( ! $+commands[jj] )); then + return +fi + +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `jj`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_jj" ]]; then + typeset -g -A _comps + autoload -Uz _jj + _comps[jj]=_jj +fi + +jj util completion zsh >| "$ZSH_CACHE_DIR/completions/_jj" &| + +function __jj_prompt_jj() { + local -a flags + flags=("--no-pager") + if zstyle -t ':omz:plugins:jj' ignore-working-copy; then + flags+=("--ignore-working-copy") + fi + command jj $flags "$@" +} + +# convenience functions for themes +function jj_prompt_template_raw() { + __jj_prompt_jj log --no-graph -r @ -T "$@" 2> /dev/null +} + +function jj_prompt_template() { + local out + out=$(jj_prompt_template_raw "$@") || return 1 + echo "${out:gs/%/%%}" +} + +# Aliases (sorted alphabetically) +alias jjc='jj commit' +alias jjcmsg='jj commit --message' +alias jjd='jj diff' +alias jjdmsg='jj desc --message' +alias jjds='jj desc' +alias jje='jj edit' +alias jjgcl='jj git clone' +alias jjgf='jj git fetch' +alias jjgp='jj git push' +alias jjl='jj log' +alias jjla='jj log -r "all()"' +alias jjn='jj new' +alias jjrb='jj rebase' +alias jjrs='jj restore' +alias jjrt='cd "$(jj root || echo .)"' +alias jjsp='jj split' +alias jjsq='jj squash' From 1c2127727af0ac452292f844ee32306f12906d03 Mon Sep 17 00:00:00 2001 From: nasso <11479594+nasso@users.noreply.github.com> Date: Tue, 4 Mar 2025 11:46:29 +0100 Subject: [PATCH 35/62] feat(jj): enable dynamic completion (#13003) --- plugins/jj/jj.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh index 9f683923d..06c04958b 100644 --- a/plugins/jj/jj.plugin.zsh +++ b/plugins/jj/jj.plugin.zsh @@ -11,7 +11,7 @@ if [[ ! -f "$ZSH_CACHE_DIR/completions/_jj" ]]; then _comps[jj]=_jj fi -jj util completion zsh >| "$ZSH_CACHE_DIR/completions/_jj" &| +COMPLETE=zsh jj >| "$ZSH_CACHE_DIR/completions/_jj" &| function __jj_prompt_jj() { local -a flags From f97e871c33da57d20e1b0411da6b1674126192a9 Mon Sep 17 00:00:00 2001 From: Gary Wei <33930674+garywei944@users.noreply.github.com> Date: Tue, 11 Mar 2025 01:51:15 -0700 Subject: [PATCH 36/62] fix(conda): correct typo in alias parameter (#13010) Closes #13009 --- plugins/conda/conda.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/conda/conda.plugin.zsh b/plugins/conda/conda.plugin.zsh index a93ceeb95..7a130ba7b 100644 --- a/plugins/conda/conda.plugin.zsh +++ b/plugins/conda/conda.plugin.zsh @@ -14,8 +14,8 @@ alias cnl='conda list' alias cnle='conda list --export' alias cnles='conda list --explicit > spec-file.txt' alias cnr='conda remove' -alias cnrn='conda remove -y -all -n' -alias cnrp='conda remove -y -all -p' +alias cnrn='conda remove -y --all -n' +alias cnrp='conda remove -y --all -p' alias cnry='conda remove -y' alias cnsr='conda search' alias cnu='conda update' From 34e9830dd399b6e068e41907def76a7e97653219 Mon Sep 17 00:00:00 2001 From: Linda TJ Date: Thu, 20 Mar 2025 11:22:12 +0100 Subject: [PATCH 37/62] fix(ranq-quote): use https for quote retrieval (#13021) --- plugins/rand-quote/rand-quote.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/rand-quote/rand-quote.plugin.zsh b/plugins/rand-quote/rand-quote.plugin.zsh index 23c21dc8f..1eda54caa 100644 --- a/plugins/rand-quote/rand-quote.plugin.zsh +++ b/plugins/rand-quote/rand-quote.plugin.zsh @@ -8,7 +8,7 @@ function quote { # Get random quote data local data - data="$(command curl -s --connect-timeout 2 "http://www.quotationspage.com/random.php" \ + data="$(command curl -s --connect-timeout 2 "https://www.quotationspage.com/random.php" \ | iconv -c -f ISO-8859-1 -t UTF-8 \ | command grep -a -m 1 'dt class="quote"')" From bea0dd2ca02cdb2c6cc88f2478aafe87a743f42a Mon Sep 17 00:00:00 2001 From: Robert Dober Date: Thu, 20 Mar 2025 11:30:05 +0100 Subject: [PATCH 38/62] feat(mix): autocomplete `format` command (#13012) --- plugins/mix/_mix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/mix/_mix b/plugins/mix/_mix index 656c7fe19..346fc8c4f 100644 --- a/plugins/mix/_mix +++ b/plugins/mix/_mix @@ -146,6 +146,16 @@ case $state in (help) _arguments ':feature:__task_list' ;; + (format) + _arguments -C \ + '--check-formatted' \ + '--dot-formatter' \ + '--dry-run' \ + '--force' \ + '--migrate' \ + '--no-exit' \ + '*::file:_files' + ;; (test) _files ;; From da2510c199edfd3fd28d6297b38ff129b20d3d91 Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Thu, 20 Mar 2025 11:41:27 -0700 Subject: [PATCH 39/62] fix(nicoluaj): avoid overriding customization params (#12859) --- themes/nicoulaj.zsh-theme | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) mode change 100644 => 100755 themes/nicoulaj.zsh-theme diff --git a/themes/nicoulaj.zsh-theme b/themes/nicoulaj.zsh-theme old mode 100644 new mode 100755 index 685cd1ade..6435c3833 --- a/themes/nicoulaj.zsh-theme +++ b/themes/nicoulaj.zsh-theme @@ -12,12 +12,12 @@ # ------------------------------------------------------------------------------ # Customizable parameters. -PROMPT_PATH_MAX_LENGTH=30 -PROMPT_DEFAULT_END=❯ -PROMPT_ROOT_END=❯❯❯ -PROMPT_SUCCESS_COLOR=$FG[071] -PROMPT_FAILURE_COLOR=$FG[124] -PROMPT_VCS_INFO_COLOR=$FG[242] +PROMPT_PATH_MAX_LENGTH=${PROMPT_PATH_MAX_LENGTH:-30} +PROMPT_DEFAULT_END=${PROMPT_DEFAULT_END:-❯} +PROMPT_ROOT_END=${PROMPT_ROOT_END:-❯❯❯} +PROMPT_SUCCESS_COLOR=${PROMPT_SUCCESS_COLOR:-$FG[071]} +PROMPT_FAILURE_COLOR=${PROMPT_FAILURE_COLOR:-$FG[124]} +PROMPT_VCS_INFO_COLOR=${PROMPT_VCS_INFO_COLOR:-$FG[242]} # Set required options. setopt promptsubst From 6591606d566cb37d53a7b996f0ff05a59998dc16 Mon Sep 17 00:00:00 2001 From: Ken van der Eerden <15888558+Ken-vdE@users.noreply.github.com> Date: Thu, 20 Mar 2025 19:43:08 +0100 Subject: [PATCH 40/62] feat(jira): add `project` command to open project (#12851) --- plugins/jira/README.md | 1 + plugins/jira/_jira | 1 + plugins/jira/jira.plugin.zsh | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/plugins/jira/README.md b/plugins/jira/README.md index 19266e7f0..f6e2e26f4 100644 --- a/plugins/jira/README.md +++ b/plugins/jira/README.md @@ -26,6 +26,7 @@ This plugin supplies one command, `jira`, through which all its features are exp | `jira new` | Opens a new Jira issue dialogue | | `jira ABC-123` | Opens an existing issue | | `jira ABC-123 m` | Opens an existing issue for adding a comment | +| `jira project ABC` | Opens JIRA project summary | | `jira dashboard [rapid_view]` | Opens your JIRA dashboard | | `jira mine` | Queries for your own issues | | `jira tempo` | Opens your JIRA Tempo | diff --git a/plugins/jira/_jira b/plugins/jira/_jira index 5f7dcd09d..617a3e501 100644 --- a/plugins/jira/_jira +++ b/plugins/jira/_jira @@ -5,6 +5,7 @@ local -a _1st_arguments _1st_arguments=( 'new:create a new issue' 'mine:open my issues' + 'project:open the project' 'dashboard:open the dashboard' 'tempo:open the tempo' 'reported:search for issues reported by a user' diff --git a/plugins/jira/jira.plugin.zsh b/plugins/jira/jira.plugin.zsh index 22e0c82c7..0c90544d5 100644 --- a/plugins/jira/jira.plugin.zsh +++ b/plugins/jira/jira.plugin.zsh @@ -8,6 +8,7 @@ jira Performs the default action jira new Opens a new Jira issue dialogue jira ABC-123 Opens an existing issue jira ABC-123 m Opens an existing issue for adding a comment +jira project ABC Opens JIRA project summary jira dashboard [rapid_view] Opens your JIRA dashboard jira mine Queries for your own issues jira tempo Opens your JIRA Tempo @@ -88,6 +89,9 @@ function jira() { elif [[ "$action" == "mine" ]]; then echo "Opening my issues" open_command "${jira_url}/issues/?filter=-1" + elif [[ "$action" == "project" ]]; then + echo "Opening project" + open_command "${jira_url}/jira/software/c/projects/${2}/summary" elif [[ "$action" == "dashboard" ]]; then echo "Opening dashboard" if [[ "$JIRA_RAPID_BOARD" == "true" ]]; then From 070f823a84642ba93b844fa80382e8375ca941c8 Mon Sep 17 00:00:00 2001 From: bretello Date: Thu, 20 Mar 2025 19:44:01 +0100 Subject: [PATCH 41/62] feat(uv): alias `uv` with `noglob` (#12866) --- plugins/uv/uv.plugin.zsh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/uv/uv.plugin.zsh b/plugins/uv/uv.plugin.zsh index f1ad37e15..abcbc117e 100644 --- a/plugins/uv/uv.plugin.zsh +++ b/plugins/uv/uv.plugin.zsh @@ -3,6 +3,8 @@ if (( ! ${+commands[uv]} )); then return fi +alias uv="noglob uv" + alias uva='uv add' alias uvexp='uv export --format requirements-txt --no-hashes --output-file requirements.txt --quiet' alias uvl='uv lock' From 85d60d489c54150cc9df5cef0504f6af90638fbd Mon Sep 17 00:00:00 2001 From: Kristijan Date: Fri, 21 Mar 2025 05:47:01 +1100 Subject: [PATCH 42/62] feat(dirhistory): add support for ghostty (#12868) --- plugins/dirhistory/dirhistory.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8d67c6188..8d66de7f5 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -137,6 +137,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2 + ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty esac if (( ${+terminfo[kcub1]} )); then @@ -152,6 +153,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2 + ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty esac if (( ${+terminfo[kcuf1]} )); then @@ -200,6 +202,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[[A" dirhistory_zle_dirhistory_up ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[A" dirhistory_zle_dirhistory_up ;; # iTerm2 + ghostty) bindkey -M $keymap "^[[1;3A" dirhistory_zle_dirhistory_up ;; # ghostty esac if (( ${+terminfo[kcuu1]} )); then @@ -215,6 +218,7 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[[B" dirhistory_zle_dirhistory_down ;; # Terminal.app iTerm.app) bindkey -M $keymap "^[^[[B" dirhistory_zle_dirhistory_down ;; # iTerm2 + ghostty) bindkey -M $keymap "^[[1;3B" dirhistory_zle_dirhistory_down ;; # ghostty esac if (( ${+terminfo[kcud1]} )); then From 5eaebdf0fe870a8c599c89c6b70a0c5ee8c78b42 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 20 Mar 2025 20:02:34 +0100 Subject: [PATCH 43/62] fix(termsupport): ensure ohmyzsh can run with `set -eu` Closes #12870 --- lib/async_prompt.zsh | 3 ++- lib/termsupport.zsh | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/async_prompt.zsh b/lib/async_prompt.zsh index db48446e7..151e24b8c 100644 --- a/lib/async_prompt.zsh +++ b/lib/async_prompt.zsh @@ -26,7 +26,7 @@ autoload -Uz is-at-least # This API is subject to change and optimization. Rely on it at your own risk. function _omz_register_handler { - setopt localoptions noksharrays + setopt localoptions noksharrays unset typeset -ga _omz_async_functions # we want to do nothing if there's no $1 function or we already set it up if [[ -z "$1" ]] || (( ! ${+functions[$1]} )) \ @@ -44,6 +44,7 @@ function _omz_register_handler { # Set up async handlers and callbacks function _omz_async_request { + setopt localoptions noksharrays unset local -i ret=$? typeset -gA _OMZ_ASYNC_FDS _OMZ_ASYNC_PIDS _OMZ_ASYNC_OUTPUT diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 087bae9bb..d2fbf42cd 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -47,7 +47,7 @@ fi # Runs before showing the prompt function omz_termsupport_precmd { - [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return + [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0 title "$ZSH_THEME_TERM_TAB_TITLE_IDLE" "$ZSH_THEME_TERM_TITLE_IDLE" } @@ -145,6 +145,7 @@ esac # Identifies the directory using a file: URI scheme, including # the host name to disambiguate local vs. remote paths. function omz_termsupport_cwd { + setopt localoptions unset # Percent-encode the host and path names. local URL_HOST URL_PATH URL_HOST="$(omz_urlencode -P $HOST)" || return 1 From 068299685ceac5af570232ca5daa0ecd4d1f7d62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 20 Mar 2025 20:07:36 +0100 Subject: [PATCH 44/62] fix(dirhistory): support iTerm2 natural text key bindings (#11026) Fixes #11026 Fixes #11407 --- plugins/dirhistory/dirhistory.plugin.zsh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 8d66de7f5..4650666be 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -136,8 +136,11 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # Terminal.app - iTerm.app) bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back ;; # iTerm2 ghostty) bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back ;; # ghostty + iTerm.app) + bindkey -M $keymap "^[^[[D" dirhistory_zle_dirhistory_back + bindkey -M $keymap "^[b" dirhistory_zle_dirhistory_back + ;; esac if (( ${+terminfo[kcub1]} )); then @@ -152,8 +155,11 @@ for keymap in emacs vicmd viins; do case "$TERM_PROGRAM" in Apple_Terminal) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # Terminal.app - iTerm.app) bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future ;; # iTerm2 ghostty) bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future ;; # ghostty + iTerm.app) + bindkey -M $keymap "^[^[[C" dirhistory_zle_dirhistory_future + bindkey -M $keymap "^[f" dirhistory_zle_dirhistory_future + ;; esac if (( ${+terminfo[kcuf1]} )); then From ec07c79d7ef9f30d4f7aef7eb54b605cd78bfb3d Mon Sep 17 00:00:00 2001 From: Xin Li Date: Thu, 20 Mar 2025 12:25:40 -0700 Subject: [PATCH 45/62] feat(tmux): refresh global environments automatically (#5282) --- plugins/tmux/tmux.plugin.zsh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index 51cc7d6a5..f6de9166f 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -15,6 +15,8 @@ fi : ${ZSH_TMUX_AUTOQUIT:=$ZSH_TMUX_AUTOSTART} # Automatically name the new session based on the basename of PWD : ${ZSH_TMUX_AUTONAME_SESSION:=false} +# Automatically pick up tmux environments +: ${ZSH_TMUX_AUTOREFRESH:=true} # Set term to screen or screen-256color based on current terminal support : ${ZSH_TMUX_DETACHED:=false} # Set detached mode @@ -158,6 +160,15 @@ function _zsh_tmux_plugin_run() { fi } +# Refresh tmux environment variables. +function _zsh_tmux_plugin_preexec() +{ + local -a tmux_cmd + tmux_cmd=(command tmux) + + eval $($tmux_cmd show-environment -s) +} + # Use the completions for tmux for our function compdef _tmux _zsh_tmux_plugin_run # Alias tmux to our wrapper function. @@ -184,3 +195,9 @@ if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z _zsh_tmux_plugin_run fi fi + +# Automatically refresh tmux environments if tmux is running. +if [[ -n "$TMUX" && "$ZSH_TMUX_AUTOREFRESH" == "true" ]] && tmux ls >/dev/null 2>/dev/null; then + autoload -U add-zsh-hook + add-zsh-hook preexec _zsh_tmux_plugin_preexec +fi From 0c8c7bf2a8efa66b504d17e3b56881925a580b40 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 20 Mar 2025 20:23:47 +0100 Subject: [PATCH 46/62] docs(tmux): add note to README for #5282 --- plugins/tmux/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 28ad3558a..53607b8ad 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -31,6 +31,7 @@ The plugin also supports the following: | Variable | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | +| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `true`) | | `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | From 22ec00d1f62ffe9c5e04d6eefc49be40e082407d Mon Sep 17 00:00:00 2001 From: Gurram Siddarth Reddy <73605274+siddarthreddygsr@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:59:33 +0530 Subject: [PATCH 47/62] chore(install): option case matching (#12881) --- tools/install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index e5f126915..5c9b2c18d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -399,8 +399,8 @@ EOF "$FMT_YELLOW" "$FMT_RESET" read -r opt case $opt in - y*|Y*|"") ;; - n*|N*) echo "Shell change skipped."; return ;; + [Yy]*|"") ;; + [Nn]*) echo "Shell change skipped."; return ;; *) echo "Invalid choice. Shell change skipped."; return ;; esac From 407be8f0368379892f7c0d5a3994bfca74e06969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Thu, 20 Mar 2025 20:28:39 +0100 Subject: [PATCH 48/62] feat(dirhistory): preserve forward directories with `cde` alias (#9328) Closes #11954 Co-authored-by: Jeff Williams --- plugins/dirhistory/README.md | 43 ++++++++++++++++++++++++ plugins/dirhistory/dirhistory.plugin.zsh | 3 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/plugins/dirhistory/README.md b/plugins/dirhistory/README.md index ede9b5410..66e3e0469 100644 --- a/plugins/dirhistory/README.md +++ b/plugins/dirhistory/README.md @@ -60,3 +60,46 @@ to `/usr` again. After that, Alt + Down will probably go to `/usr/bin` if `bin` is the first directory in alphabetical order (depends on your `/usr` folder structure). Alt + Up will return to `/usr`, and once more will get you to the root folder (`/`). + +### cde + +This plugin also provides a `cde` alias that allows you to change to a directory without clearing the next directory stack. +This changes the default behavior of `dirhistory`, which is to clear the next directory stack when changing directories. + +For example, if the shell was started, and the following commands were entered: + +```shell +cd ~ +cd /usr +cd share +cd doc + +# +# +``` + +The directory stack would look like this: + +```sh +➜ /usr typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr ) +typeset -ax dirhistory_future=( /usr/share/doc /usr/share ) +``` + +This means that pressing Alt + Right, you'd go to `/usr/share` and `/usr/share/doc` (the "future" directories). + +If you run `cd /usr/bin`, the "future" directories will be removed, and you won't be able to access them with Alt + Right: + +```sh +➜ /u/bin typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr ) +typeset -ax dirhistory_future=( /usr/bin ) +``` + +If you instead run `cde /usr/bin`, the "future" directories will be preserved: + +```sh +➜ /u/bin typeset -pm dirhistory_\* +typeset -ax dirhistory_past=( /home/user /usr /usr/bin ) +typeset -ax dirhistory_future=( /usr/share/doc /usr/share ) +``` diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index 4650666be..706bb6fb2 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -11,9 +11,10 @@ dirhistory_past=($PWD) dirhistory_future=() export dirhistory_past export dirhistory_future - export DIRHISTORY_SIZE=30 +alias cde='dirhistory_cd' + # Pop the last element of dirhistory_past. # Pass the name of the variable to return the result in. # Returns the element if the array was not empty, From ac1335125cb7fe742d825a95bb288ff8a8bfadd9 Mon Sep 17 00:00:00 2001 From: Adil Erchouk Date: Thu, 20 Mar 2025 20:36:07 +0100 Subject: [PATCH 49/62] feat(macos): add support for Ghostty (#12890) --- plugins/macos/README.md | 1 + plugins/macos/macos.plugin.zsh | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/plugins/macos/README.md b/plugins/macos/README.md index 8245e211f..ccc4331e5 100644 --- a/plugins/macos/README.md +++ b/plugins/macos/README.md @@ -13,6 +13,7 @@ plugins=(... macos) - [iTerm2](https://iterm2.com/) - [Hyper](https://hyper.is/) - [Tabby](https://tabby.sh/) +- [Ghostty](https://ghostty.org) ## Commands diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index b951a289f..6ddf31ecf 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -85,6 +85,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "t" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 @@ -139,6 +145,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "D" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 @@ -194,6 +206,12 @@ EOF tell application "System Events" tell process "Tabby" to keystroke "d" using command down end tell +EOF + elif [[ "$the_app" == 'ghostty' ]]; then + osascript >/dev/null <&2 From 899af6328b395f1db2e74d09880a1af435a188ca Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Fri, 21 Mar 2025 12:47:25 +0100 Subject: [PATCH 50/62] fix(bgnotify): detect if sway is running and not just installed (#12989) Co-authored-by: Carlo Sala --- plugins/bgnotify/bgnotify.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index f6ffb6ed5..dca8250be 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -62,7 +62,7 @@ function bgnotify_formatted { function bgnotify_appid { if (( ${+commands[osascript]} )); then osascript -e "tell application id \"$(bgnotify_programid)\" to get the {id, frontmost, id of front window, visible of front window}" 2>/dev/null - elif [[ -n $WAYLAND_DISPLAY ]] && (( ${+commands[swaymsg]} )); then # wayland+sway + elif [[ -n $WAYLAND_DISPLAY ]] && ([[ -n $SWAYSOCK ]] || [[ -n $I3SOCK ]]) && (( ${+commands[swaymsg]} )); then # wayland+sway local app_id=$(bgnotify_find_sway_appid) [[ -n "$app_id" ]] && echo "$app_id" || echo $EPOCHSECONDS elif [[ -z $WAYLAND_DISPLAY ]] && [[ -n $DISPLAY ]] && (( ${+commands[xprop]} )); then From eeaf9f89b0e8b10a02f16cb6cdd93779c28eb2ea Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 24 Mar 2025 20:52:31 +0100 Subject: [PATCH 51/62] fix(tmux): disable AUTOREFRESH by default (#13034) --- plugins/tmux/README.md | 2 +- plugins/tmux/tmux.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tmux/README.md b/plugins/tmux/README.md index 53607b8ad..39c57f846 100644 --- a/plugins/tmux/README.md +++ b/plugins/tmux/README.md @@ -31,7 +31,7 @@ The plugin also supports the following: | Variable | Description | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `true`) | +| `ZSH_TMUX_AUTOREFRESH` | Automatically refresh global environments (default: `false`) | | `ZSH_TMUX_AUTOSTART` | Automatically starts tmux (default: `false`) | | `ZSH_TMUX_AUTOSTART_ONCE` | Autostart only if tmux hasn't been started previously (default: `true`) | | `ZSH_TMUX_AUTOCONNECT` | Automatically connect to a previous session if it exits (default: `true`) | diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index f6de9166f..d2729ec09 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -16,7 +16,7 @@ fi # Automatically name the new session based on the basename of PWD : ${ZSH_TMUX_AUTONAME_SESSION:=false} # Automatically pick up tmux environments -: ${ZSH_TMUX_AUTOREFRESH:=true} +: ${ZSH_TMUX_AUTOREFRESH:=false} # Set term to screen or screen-256color based on current terminal support : ${ZSH_TMUX_DETACHED:=false} # Set detached mode From 1de190e4391ce6c2fbe2bdf0025104cf3cb98231 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Wed, 26 Mar 2025 01:56:06 +0900 Subject: [PATCH 52/62] fix(alias-finder): early return on cmd len <2 (#13030) --- plugins/alias-finder/alias-finder.plugin.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 5fdfbc835..4786431f3 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -36,7 +36,11 @@ alias-finder() { # make filter to find only shorter results than current cmd if [[ $cheaper == true ]]; then cmdLen=$(echo -n "$cmd" | wc -c) - filter="^'{0,1}.{0,$((cmdLen - 1))}=" + if [[ $cmdLen -le 1 ]]; then + return + fi + + filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes fi alias | grep -E "$filter" | grep -E "=$finder" From 4efdc90dba95200b010def504c471f0e191fea84 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Wed, 26 Mar 2025 02:03:02 +0900 Subject: [PATCH 53/62] docs(docker): add section for podman's docker wrapper (#13024) --- plugins/docker/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index 8619125a2..a9f842db2 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -39,6 +39,10 @@ following setting. See https://github.com/ohmyzsh/ohmyzsh/issues/11789 for more zstyle ':omz:plugins:docker' legacy-completion yes ``` +### For Podman's Docker wrapper users + +If you use Podman's Docker wrapper, you need to enable legacy completion. See above section. + ## Aliases | Alias | Command | Description | From fa396ad7718af77e896472772bffd4a7e9110193 Mon Sep 17 00:00:00 2001 From: Chriss <77172965+realChriss@users.noreply.github.com> Date: Tue, 25 Mar 2025 18:04:39 +0100 Subject: [PATCH 54/62] feat(docker): add alias for stats (#12988) --- plugins/docker/README.md | 1 + plugins/docker/docker.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/docker/README.md b/plugins/docker/README.md index a9f842db2..0bc24b54a 100644 --- a/plugins/docker/README.md +++ b/plugins/docker/README.md @@ -77,6 +77,7 @@ If you use Podman's Docker wrapper, you need to enable legacy completion. See ab | drs | `docker container restart` | Restart one or more containers | | dsta | `docker stop $(docker ps -q)` | Stop all running containers | | dstp | `docker container stop` | Stop one or more running containers | +| dsts | `docker stats` | Display real-time streaming statistics for containers | | dtop | `docker top` | Display the running processes of a container | | dvi | `docker volume inspect` | Display detailed information about one or more volumes | | dvls | `docker volume ls` | List all the volumes known to docker | diff --git a/plugins/docker/docker.plugin.zsh b/plugins/docker/docker.plugin.zsh index 16db77df6..5268f6cd6 100644 --- a/plugins/docker/docker.plugin.zsh +++ b/plugins/docker/docker.plugin.zsh @@ -28,6 +28,7 @@ alias dst='docker container start' alias drs='docker container restart' alias dsta='docker stop $(docker ps -q)' alias dstp='docker container stop' +alias dsts='docker stats' alias dtop='docker top' alias dvi='docker volume inspect' alias dvls='docker volume ls' From 506cedb7ca1f4ba91a0ad102e8395d194c0b1a59 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sat, 29 Mar 2025 18:38:29 +0900 Subject: [PATCH 55/62] chore(alias-finder): code style (#13038) --- plugins/alias-finder/alias-finder.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 4786431f3..2351a439e 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -47,7 +47,7 @@ alias-finder() { if [[ $exact == true ]]; then break # because exact case is only one - elif [[ $longer = true ]]; then + elif [[ $longer == true ]]; then break # because above grep command already found every longer aliases during first cycle fi From 346c09d469c9d2681399b0938e9af883ebdae829 Mon Sep 17 00:00:00 2001 From: Mikrz Date: Sat, 29 Mar 2025 05:40:25 -0400 Subject: [PATCH 56/62] fix(dnf): function name typo (#13040) --- plugins/dnf/_dnf5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/dnf/_dnf5 b/plugins/dnf/_dnf5 index e194dd5a7..9cbf451a8 100644 --- a/plugins/dnf/_dnf5 +++ b/plugins/dnf/_dnf5 @@ -38,7 +38,7 @@ _dnf5_rpm_files() { _dnf5_packages_or_rpms() { if [[ "$words[CURRENT]" = (*/*|\~*) ]]; then # if looks like a path name - _dnf_rpm_files + _dnf5_rpm_files else _dnf5_packages "$@" fi From 2f3a141f65ba082e1eb42ea3123fc2bd978c0c83 Mon Sep 17 00:00:00 2001 From: Kartik Vashistha Date: Sat, 29 Mar 2025 02:42:46 -0700 Subject: [PATCH 57/62] docs(asdf): match README with 0.16 (#13026) Co-authored-by: Carlo Sala --- plugins/asdf/README.md | 49 ++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md index 4af69a75c..e8ff2d740 100644 --- a/plugins/asdf/README.md +++ b/plugins/asdf/README.md @@ -1,32 +1,39 @@ -## asdf +# asdf Adds integration with [asdf](https://github.com/asdf-vm/asdf), the extendable version manager, with support for Ruby, Node.js, Elixir, Erlang and more. -### Installation +## Installation -1. [Download asdf](https://asdf-vm.com/guide/getting-started.html#_2-download-asdf) by running the following: - - ``` - git clone https://github.com/asdf-vm/asdf.git ~/.asdf - ``` - -2. [Enable asdf](https://asdf-vm.com/guide/getting-started.html#_3-install-asdf) by adding it to your `plugins` definition in `~/.zshrc`. - - ``` - plugins=(asdf) - ``` - -### Usage - -See the [asdf documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to use asdf: +1. [Install](https://asdf-vm.com/guide/getting-started.html#_1-install-asdf) asdf and ensure that's it's discoverable on `$PATH`; +2. Enable it by adding it to your `plugins` definition in `~/.zshrc`: +```sh +plugins=(asdf) ``` -asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git + +## Usage + +Refer to the [asdf plugin documentation](https://asdf-vm.com/guide/getting-started.html#_4-install-a-plugin) for information on how to add a plugin and install the many runtime versions for it. + +Example for installing the nodejs plugin and the many runtimes for it: + +```sh +# Add plugin to asdf +asdf plugin add nodejs + +# Install the latest available nodejs runtime version asdf install nodejs latest -asdf global nodejs latest -asdf local nodejs latest + +# Install nodejs v16.5.0 runtime version +asdf install nodejs 16.5.0 + +# Set the latest version in .tools-version in the current working directory +asdf set nodejs latest + +# Set a version globally that will apply to all directories under $HOME +asdf set -u nodejs 16.5.0 ``` -### Maintainer +## Maintainer - [@RobLoach](https://github.com/RobLoach) From a78d006faa022a5104b542d7dec5a3439e72046e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 29 Mar 2025 10:47:03 +0100 Subject: [PATCH 58/62] fix(asdf)!: remove legacy <0.16 integration `asdf` plugin only supports asdf 0.16 and ahead from now on. --- plugins/asdf/asdf.plugin.zsh | 55 +++++++----------------------------- 1 file changed, 10 insertions(+), 45 deletions(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 4367e8ca3..318267dcb 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,48 +1,13 @@ -if (( $+commands[asdf] )); then - export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" - path=("$ASDF_DATA_DIR/shims" $path) +(( ! $+commands[asdf] )) && return - # If the completion file doesn't exist yet, we need to autoload it and - # bind it to `asdf`. Otherwise, compinit will have already done that. - if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then - typeset -g -A _comps - autoload -Uz _asdf - _comps[asdf]=_asdf - fi - asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| +export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" +path=("$ASDF_DATA_DIR/shims" $path) - return -fi - -# TODO:(2025-02-12): remove deprecated asdf <0.16 code - -# Find where asdf should be installed -ASDF_DIR="${ASDF_DIR:-$HOME/.asdf}" -ASDF_COMPLETIONS="$ASDF_DIR/completions" - -if [[ ! -f "$ASDF_DIR/asdf.sh" || ! -f "$ASDF_COMPLETIONS/_asdf" ]]; then - # If not found, check for archlinux/AUR package (/opt/asdf-vm/) - if [[ -f "/opt/asdf-vm/asdf.sh" ]]; then - ASDF_DIR="/opt/asdf-vm" - ASDF_COMPLETIONS="$ASDF_DIR" - # If not found, check for Homebrew package - elif (( $+commands[brew] )); then - _ASDF_PREFIX="$(brew --prefix asdf)" - ASDF_DIR="${_ASDF_PREFIX}/libexec" - ASDF_COMPLETIONS="${_ASDF_PREFIX}/share/zsh/site-functions" - unset _ASDF_PREFIX - else - return - fi -fi - -# Load command -if [[ -f "$ASDF_DIR/asdf.sh" ]]; then - source "$ASDF_DIR/asdf.sh" - # Load completions - if [[ -f "$ASDF_COMPLETIONS/_asdf" ]]; then - fpath+=("$ASDF_COMPLETIONS") - autoload -Uz _asdf - compdef _asdf asdf # compdef is already loaded before loading plugins - fi +# If the completion file doesn't exist yet, we need to autoload it and +# bind it to `asdf`. Otherwise, compinit will have already done that. +if [[ ! -f "$ZSH_CACHE_DIR/completions/_asdf" ]]; then + typeset -g -A _comps + autoload -Uz _asdf + _comps[asdf]=_asdf fi +asdf completion zsh >| "$ZSH_CACHE_DIR/completions/_asdf" &| From f81259fb344685e2dc8b67f8ad8764ccd4e8502e Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 29 Mar 2025 12:55:20 +0100 Subject: [PATCH 59/62] fix(cli): support `noexec` environments (#13042) Closes #13032 --- lib/cli.zsh | 2 +- tools/upgrade.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index aed86e758..3b6308313 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -193,7 +193,7 @@ EOF return 1 fi - "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" "$version" "${2:-}" "$format" } function _omz::plugin { diff --git a/tools/upgrade.sh b/tools/upgrade.sh index c586610c4..1aa3d8af4 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -254,7 +254,7 @@ if LANG= git pull --quiet --rebase $remote $branch; then # Print changelog to the terminal if [[ $interactive == true && $verbose_mode == default ]]; then - "$ZSH/tools/changelog.sh" HEAD "$last_commit" + ZSH="$ZSH" command zsh -f "$ZSH/tools/changelog.sh" HEAD "$last_commit" fi if [[ $verbose_mode != silent ]]; then From 750d3ac4b493dca13ef0ced55fa6a2cd02dc7ee8 Mon Sep 17 00:00:00 2001 From: Sidar <65621366+Maple38@users.noreply.github.com> Date: Thu, 3 Apr 2025 17:38:51 +0300 Subject: [PATCH 60/62] fix(macos): use `command man` instead of `man` (#13046) --- plugins/macos/macos.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index 6ddf31ecf..4d73d22c3 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -271,7 +271,7 @@ function man-preview() { [[ $# -eq 0 ]] && >&2 echo "Usage: $0 command1 [command2 ...]" && return 1 local page - for page in "${(@f)"$(man -w $@)"}"; do + for page in "${(@f)"$(command man -w $@)"}"; do command mandoc -Tpdf $page | open -f -a Preview done } From a84a0332a822a78ddf3f66d0e1ed3990d4badd12 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 13 Apr 2025 23:11:55 +0200 Subject: [PATCH 61/62] chore(deps): bump urllib3 in /.github/workflows/dependencies (#13065) Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/2.3.0...2.4.0) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.4.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/dependencies/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dependencies/requirements.txt b/.github/workflows/dependencies/requirements.txt index 910db7bac..f2044a5f5 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -4,4 +4,4 @@ idna==3.10 PyYAML==6.0.2 requests==2.32.3 semver==3.0.4 -urllib3==2.3.0 +urllib3==2.4.0 From c1e5ff31693f391a0bbb30b12c8e7bc1cc976b7b Mon Sep 17 00:00:00 2001 From: swivelmargarita <55573157+swivelmargarita@users.noreply.github.com> Date: Thu, 17 Apr 2025 19:57:53 +0500 Subject: [PATCH 62/62] fix(branch): handle branches with `/` properly (#13063) Co-authored-by: Takha Polat --- plugins/branch/branch.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/branch/branch.plugin.zsh b/plugins/branch/branch.plugin.zsh index dd5871fdc..c24f9098e 100644 --- a/plugins/branch/branch.plugin.zsh +++ b/plugins/branch/branch.plugin.zsh @@ -8,7 +8,7 @@ function branch_prompt_info() { while [[ "$dir" != '/' ]]; do # Found .git directory if [[ -d "${dir}/.git" ]]; then - branch="${"$(<"${dir}/.git/HEAD")"##*/}" + branch="${"$(<"${dir}/.git/HEAD")"##ref: refs/heads/}" echo '±' "${branch:gs/%/%%}" return fi