From eeaf9f89b0e8b10a02f16cb6cdd93779c28eb2ea Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 24 Mar 2025 20:52:31 +0100 Subject: [PATCH 01/82] 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 02/82] 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 03/82] 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 04/82] 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 05/82] 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 06/82] 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 07/82] 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 08/82] 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 09/82] 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 10/82] 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 11/82] 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 12/82] 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 From a7426f0b38817bf7cd7000a5d378b7cfb059884f Mon Sep 17 00:00:00 2001 From: "Kat R." Date: Sat, 19 Apr 2025 10:49:16 -0700 Subject: [PATCH 13/82] fix(git-prompt): use `--git-common-dir` to load stash count (#13072) --- plugins/git-prompt/gitstatus.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/git-prompt/gitstatus.py b/plugins/git-prompt/gitstatus.py index 94774d828..7cd8f54e2 100644 --- a/plugins/git-prompt/gitstatus.py +++ b/plugins/git-prompt/gitstatus.py @@ -23,9 +23,10 @@ def get_tagname_or_hash(): return hash_ return None -# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stashs count +# Re-use method from https://github.com/magicmonty/bash-git-prompt to get stash count +# Use `--git-common-dir` to avoid problems with git worktrees, which don't have individual stashes def get_stash(): - cmd = Popen(['git', 'rev-parse', '--git-dir'], stdout=PIPE, stderr=PIPE) + cmd = Popen(['git', 'rev-parse', '--git-common-dir'], stdout=PIPE, stderr=PIPE) so, se = cmd.communicate() stash_file = '%s%s' % (so.decode('utf-8').rstrip(), '/logs/refs/stash') @@ -35,7 +36,6 @@ def get_stash(): except IOError: return 0 - # `git status --porcelain --branch` can collect all information # branch, remote_branch, untracked, staged, changed, conflicts, ahead, behind po = Popen(['git', 'status', '--porcelain', '--branch'], env=dict(os.environ, LANG="C"), stdout=PIPE, stderr=PIPE) From afbbdd6099085fbc6a3d06cc44f90b566302bd43 Mon Sep 17 00:00:00 2001 From: Nicholas Wilson Date: Sat, 19 Apr 2025 12:58:05 -0500 Subject: [PATCH 14/82] docs: fix typos (#13061) --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f7455228a..7f57ed55e 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ adds any) and extra goodies that are included in that particular plugin. ### Themes -We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme happy. We have over one +We'll admit it. Early in the Oh My Zsh world, we may have gotten a bit too theme-happy. We have over one hundred and fifty themes now bundled. Most of them have [screenshots](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes) on the wiki (We are working on updating this!). Check them out! @@ -218,7 +218,7 @@ terminal window. ZSH_THEME="random" # (...please let it be pie... please be some pie..) ``` -And if you want to pick random theme from a list of your favorite themes: +And if you want to pick a random theme from a list of your favorite themes: ```sh ZSH_THEME_RANDOM_CANDIDATES=( @@ -426,7 +426,7 @@ turn it off by setting the following in your .zshrc file, before Oh My Zsh is so zstyle ':omz:alpha:lib:git' async-prompt no ``` -If your problem is that the git prompt just stopped appearing, you can try to force it setting the following +If your problem is that the git prompt just stopped appearing, you can try to force it by setting the following configuration before `oh-my-zsh.sh` is sourced. If it still does not work, please open an issue with your case. From 95a0ece8d39a7797850ef7a4cc8849b6e1158706 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20A=2E=20Aranda=20Guti=C3=A9rrez?= Date: Sat, 19 Apr 2025 20:19:23 +0200 Subject: [PATCH 15/82] fix(agnoster): respect bg / fg user envs (#12897) Co-authored-by: Carlo Sala --- themes/agnoster.zsh-theme | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index adeffe8c2..21c9cf7d5 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -36,12 +36,12 @@ CURRENT_BG='NONE' case ${SOLARIZED_THEME:-dark} in light) - CURRENT_FG='white' - CURRENT_DEFAULT_FG='white' + CURRENT_FG=${CURRENT_FG:-'white'} + CURRENT_DEFAULT_FG=${CURRENT_DEFAULT_FG:-'white'} ;; *) - CURRENT_FG='black' - CURRENT_DEFAULT_FG='default' + CURRENT_FG=${CURRENT_FG:-'black'} + CURRENT_DEFAULT_FG=${CURRENT_DEFAULT_FG:-'default'} ;; esac From b92874c716776bc8a19773d12354b77d08349d7b Mon Sep 17 00:00:00 2001 From: deimosian <616215+deimosian@users.noreply.github.com> Date: Sat, 19 Apr 2025 14:44:45 -0400 Subject: [PATCH 16/82] fix(archlinux): properly check keyring version (#12979) --- plugins/archlinux/archlinux.plugin.zsh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/plugins/archlinux/archlinux.plugin.zsh b/plugins/archlinux/archlinux.plugin.zsh index e20a31156..7abd7c2f6 100644 --- a/plugins/archlinux/archlinux.plugin.zsh +++ b/plugins/archlinux/archlinux.plugin.zsh @@ -178,26 +178,27 @@ fi # Check Arch Linux PGP Keyring before System Upgrade to prevent failure. function upgrade() { + sudo pacman -Sy echo ":: Checking Arch Linux PGP Keyring..." local installedver="$(LANG= sudo pacman -Qi archlinux-keyring | grep -Po '(?<=Version : ).*')" local currentver="$(LANG= sudo pacman -Si archlinux-keyring | grep -Po '(?<=Version : ).*')" if [ $installedver != $currentver ]; then echo " Arch Linux PGP Keyring is out of date." echo " Updating before full system upgrade." - sudo pacman -Sy --needed --noconfirm archlinux-keyring + sudo pacman -S --needed --noconfirm archlinux-keyring else echo " Arch Linux PGP Keyring is up to date." echo " Proceeding with full system upgrade." fi if (( $+commands[yay] )); then - yay -Syu + yay -Su elif (( $+commands[trizen] )); then - trizen -Syu + trizen -Su elif (( $+commands[pacaur] )); then - pacaur -Syu + pacaur -Su elif (( $+commands[aura] )); then - sudo aura -Syu + sudo aura -Su else - sudo pacman -Syu + sudo pacman -Su fi } From 9957e4e8be9d63b9c42673f0eb86fa2dea845b32 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Sun, 20 Apr 2025 03:48:34 +0900 Subject: [PATCH 17/82] feat(git): add gcfu alias for `commit --fixup` (#13027) --- plugins/git/README.md | 1 + plugins/git/git.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/git/README.md b/plugins/git/README.md index bcadc4713..edddc8cd8 100644 --- a/plugins/git/README.md +++ b/plugins/git/README.md @@ -79,6 +79,7 @@ plugins=(... git) | `gcss` | `git commit -S -s` | | `gcssm` | `git commit -S -s -m` | | `gcf` | `git config --list` | +| `gcfu` | `git commit --fixup` | | `gdct` | `git describe --tags $(git rev-list --tags --max-count=1)` | | `gd` | `git diff` | | `gdca` | `git diff --cached` | diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index f34c0726b..1d043da35 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -200,6 +200,7 @@ alias gc!='git commit --verbose --amend' alias gcn='git commit --verbose --no-edit' alias gcn!='git commit --verbose --no-edit --amend' alias gcf='git config --list' +alias gcfu='git commit --fixup' alias gdct='git describe --tags $(git rev-list --tags --max-count=1)' alias gd='git diff' alias gdca='git diff --cached' From 92bad89f8a9141fcdc0b682941ee46729b6e4cb6 Mon Sep 17 00:00:00 2001 From: Arthur <82575487+arthur-mountain@users.noreply.github.com> Date: Sun, 20 Apr 2025 02:55:23 +0800 Subject: [PATCH 18/82] docs(asdf): update usage example (#13055) --- plugins/asdf/README.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/asdf/README.md b/plugins/asdf/README.md index e8ff2d740..69db6930a 100644 --- a/plugins/asdf/README.md +++ b/plugins/asdf/README.md @@ -19,21 +19,30 @@ Example for installing the nodejs plugin and the many runtimes for it: ```sh # Add plugin to asdf -asdf plugin add nodejs +asdf plugin add nodejs -# Install the latest available nodejs runtime version +# Install the latest available version asdf install nodejs latest -# Install nodejs v16.5.0 runtime version +# Uninstall the latest version +asdf uninstall nodejs latest + +# Install a specific version asdf install nodejs 16.5.0 -# Set the latest version in .tools-version in the current working directory +# Set the latest version in .tool-versions of the `current directory` asdf set nodejs latest -# Set a version globally that will apply to all directories under $HOME -asdf set -u nodejs 16.5.0 +# Set a specific version in the `parent directory` +asdf set -p nodejs 16.5.0 # -p is shorthand for --parent + +# Set a global version under `$HOME` +asdf set -u nodejs 16.5.0 # -u is shorthand for --home ``` +For more commands, run `asdf help` or refer to the +[asdf CLI documentation](https://asdf-vm.com/manage/commands.html#all-commands). + ## Maintainer - [@RobLoach](https://github.com/RobLoach) From de1ca65dcaebd19f5ca6626616bb79b529362458 Mon Sep 17 00:00:00 2001 From: Adam Page Date: Sat, 19 Apr 2025 15:08:03 -0400 Subject: [PATCH 19/82] feat(procs): support completion for `procs<0.14` (#13053) Co-authored-by: Carlo Sala --- plugins/procs/procs.plugin.zsh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/procs/procs.plugin.zsh b/plugins/procs/procs.plugin.zsh index 332985bf9..8b15f1d5d 100644 --- a/plugins/procs/procs.plugin.zsh +++ b/plugins/procs/procs.plugin.zsh @@ -3,11 +3,19 @@ if (( ! $+commands[procs] )); then fi # If the completion file doesn't exist yet, we need to autoload it and -# bind it to `minikube`. Otherwise, compinit will have already done that. +# bind it to `procs`. Otherwise, compinit will have already done that. if [[ ! -f "$ZSH_CACHE_DIR/completions/_procs" ]]; then typeset -g -A _comps autoload -Uz _procs _comps[procs]=_procs fi -procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" &| +{ + autoload -Uz is-at-least + local _version=$(procs --version) + if is-at-least "0.14" "${_version#procs }"; then + procs --gen-completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" + else + procs --completion-out zsh >| "$ZSH_CACHE_DIR/completions/_procs" + fi +} &| From 959b6cf5eed78f108dc6e0f46b53816f5168dd3a Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Thu, 24 Apr 2025 15:42:26 +0200 Subject: [PATCH 20/82] fix(emacs): do not emit ANSI escape codes in vterm Closes #13067 --- plugins/emacs/emacs.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/emacs/emacs.plugin.zsh b/plugins/emacs/emacs.plugin.zsh index 5aa621803..3ed6cee19 100644 --- a/plugins/emacs/emacs.plugin.zsh +++ b/plugins/emacs/emacs.plugin.zsh @@ -35,7 +35,7 @@ alias eeval="$EMACS_PLUGIN_LAUNCHER --eval" alias eframe='emacsclient --alternate-editor="" --create-frame' # Emacs ANSI Term tracking -if [[ -n "$INSIDE_EMACS" ]]; then +if [[ -n "$INSIDE_EMACS" ]] && [[ "$INSIDE_EMACS" != "vterm" ]]; then chpwd_emacs() { print -P "\033AnSiTc %d"; } print -P "\033AnSiTc %d" # Track current working directory print -P "\033AnSiTu %n" # Track username From 44913a1f16424f21b5989a0dd7d2c95d02047cec Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 10:25:02 +0200 Subject: [PATCH 21/82] feat(wd): update to v0.10.0 (#13093) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/_wd.sh | 4 ++++ plugins/wd/wd.sh | 24 ++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 46e7727b8..70f3d03da 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.3 + version: tag:v0.10.0 precopy: | set -e rm -r test diff --git a/plugins/wd/_wd.sh b/plugins/wd/_wd.sh index 46b032f78..7c416086d 100644 --- a/plugins/wd/_wd.sh +++ b/plugins/wd/_wd.sh @@ -37,6 +37,7 @@ function _wd() { 'rm:Removes the given warp point' 'list:Outputs all stored warp points' 'ls:Show files from given warp point' + 'open:Open warp point in the default file explorer' 'path:Show path to given warp point' 'show:Outputs all warp points that point to the current directory or shows a specific target directory for a point' 'help:Show this extremely helpful text' @@ -73,6 +74,9 @@ function _wd() { ls) _describe -t points "Warp points" warp_points && ret=0 ;; + open) + _describe -t points "Warp points" warp_points && ret=0 + ;; path) _describe -t points "Warp points" warp_points && ret=0 ;; diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index f8b27828f..f7a22ff7d 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.3 +readonly WD_VERSION=0.10.0 # colors readonly WD_BLUE="\033[96m" @@ -86,6 +86,7 @@ Commands: show Print warp points to current directory list Print all stored warp points ls Show files from given warp point (ls) + open Open the warp point in the default file explorer (open / xdg-open) path Show the path to given warp point (pwd) clean Remove points warping to nonexistent directories (will prompt unless --force is used) @@ -377,6 +378,21 @@ wd_ls() ls "${dir/#\~/$HOME}" } +wd_open() +{ + wd_getdir "$1" + if command -v open >/dev/null 2>&1; then + # MacOS, Ubuntu (alias) + open "${dir/#\~/$HOME}" + elif command -v xdg-open >/dev/null 2>&1; then + # Most Linux desktops + xdg-open "${dir/#\~/$HOME}" + else + echo "No known file opener found (need 'open' or 'xdg-open')." >&2 + exit 1 + fi +} + wd_path() { wd_getdir "$1" @@ -521,7 +537,7 @@ do done < "$wd_config_file" # get opts -args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,path:,help,show -- $*) +args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,open:,path:,help,show -- $*) # check if no arguments were given, and that version is not set if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]] @@ -571,6 +587,10 @@ else wd_ls "$2" break ;; + "-o"|"--open"|"open") + wd_open "$2" + break + ;; "-p"|"--path"|"path") wd_path "$2" break From 476a7fc89e38a0fdc483ec6452394f2f2e0413bf Mon Sep 17 00:00:00 2001 From: Michael Elliot Date: Sun, 27 Apr 2025 16:26:11 +0800 Subject: [PATCH 22/82] chore: fix typo (#13089) --- oh-my-zsh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index b1032841c..2e885219c 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -192,7 +192,7 @@ _omz_source() { fi } -# Load all of the lib files in ~/oh-my-zsh/lib that end in .zsh +# Load all of the lib files in ~/.oh-my-zsh/lib that end in .zsh # TIP: Add files you don't want in git to .gitignore for lib_file ("$ZSH"/lib/*.zsh); do _omz_source "lib/${lib_file:t}" From 137bfbbfd1e39897f02ca47e9f010b0d81cc15ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 27 Apr 2025 14:55:23 +0200 Subject: [PATCH 23/82] chore(deps): bump certifi in /.github/workflows/dependencies (#13094) Bumps [certifi](https://github.com/certifi/python-certifi) from 2025.1.31 to 2025.4.26. - [Commits](https://github.com/certifi/python-certifi/compare/2025.01.31...2025.04.26) --- updated-dependencies: - dependency-name: certifi dependency-version: 2025.4.26 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 f2044a5f5..63eadd07d 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2025.1.31 +certifi==2025.4.26 charset-normalizer==3.4.1 idna==3.10 PyYAML==6.0.2 From 2ee4f9808ff50bf35f36b28657933afd6d80e268 Mon Sep 17 00:00:00 2001 From: Anand Buddhdev Date: Tue, 29 Apr 2025 10:34:33 +0200 Subject: [PATCH 24/82] docs(python): fix typo (#13096) --- plugins/python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/python/README.md b/plugins/python/README.md index 490cf88f1..ca424ea55 100644 --- a/plugins/python/README.md +++ b/plugins/python/README.md @@ -34,7 +34,7 @@ virtual environments: `/bin/activate`, and automatically deactivate it when navigating out of it (keeps venv activated in subdirectories). - 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 plugin activates the first existing virtual environment, in order, appearing in `$PYTHON_VENV_NAMES`. The default virtual environment name is `venv`. To use a different name, set `PYTHON_VENV_NAME=`. For example: `PYTHON_VENV_NAME=".venv"` From f6a7bbf81a18d30f75bad72de3398d0f55c8792b Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 29 Apr 2025 10:42:26 +0200 Subject: [PATCH 25/82] fix(debian): avoid `aptitude` hardcoding Closes #13095 --- plugins/debian/debian.plugin.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh index 5ef4cfb67..980440c0f 100644 --- a/plugins/debian/debian.plugin.zsh +++ b/plugins/debian/debian.plugin.zsh @@ -83,9 +83,9 @@ else } alias ac="su -ls '$apt_pref clean' root" alias ad="su -lc '$apt_pref update' root" - alias adg="su -lc '$apt_pref update && aptitude $apt_upgr' root" - alias adu="su -lc '$apt_pref update && aptitude dist-upgrade' root" - alias afu="su -lc '$apt-file update'" + alias adg="su -lc '$apt_pref update && $apt_pref $apt_upgr' root" + alias adu="su -lc '$apt_pref update && $apt_pref dist-upgrade' root" + alias afu="su -lc 'apt-file update'" alias au="su -lc '$apt_pref $apt_upgr' root" function ai() { cmd="su -lc '$apt_pref install $@' root" From 8648cd640b428bdd7dea65886c2671ef1e8ffe32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 4 May 2025 17:22:51 +0200 Subject: [PATCH 26/82] chore(deps): bump charset-normalizer in /.github/workflows/dependencies (#13100) Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.1 to 3.4.2. - [Release notes](https://github.com/jawah/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/jawah/charset_normalizer/compare/3.4.1...3.4.2) --- updated-dependencies: - dependency-name: charset-normalizer dependency-version: 3.4.2 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 63eadd07d..e73c1b5ca 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,5 +1,5 @@ certifi==2025.4.26 -charset-normalizer==3.4.1 +charset-normalizer==3.4.2 idna==3.10 PyYAML==6.0.2 requests==2.32.3 From 51d0e0aa1de9c7f96012b9a0feda6509ed2a025b Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Mon, 5 May 2025 14:00:29 +0300 Subject: [PATCH 27/82] docs(pip): add explanation for aliases (#13103) --- plugins/pip/README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/plugins/pip/README.md b/plugins/pip/README.md index 70d40c79f..9d1daca9f 100644 --- a/plugins/pip/README.md +++ b/plugins/pip/README.md @@ -20,17 +20,17 @@ the next time you autocomplete `pip install`. ## Aliases -| Alias | Description | -| :------- | :-------------------------------------------- | -| pipi | Install packages | -| pipig | Install package from GitHub repository | -| pipigb | Install package from GitHub branch | -| pipigp | Install package from GitHub pull request | -| pipu | Upgrade packages | -| pipun | Uninstall packages | -| pipgi | Grep through installed packages | -| piplo | List outdated packages | -| pipreq | Create requirements file | -| pipir | Install packages from `requirements.txt` file | -| pipupall | Update all installed packages | -| pipunall | Uninstall all installed packages | +| Alias | Command | Description | +| :--------|:----------------------------------------------------------------------------------|:--------------------------------------------- | +| pipi | `pip install` | Install packages | +| pipig | `pip install "git+https://github.com/user/repo.git"` | Install package from GitHub repository | +| pipigb | `pip install "git+https://github.com/user/repo.git@branch"` | Install package from GitHub branch | +| pipigp | `pip install "git+https://github.com/user/repo.git@refs/pull/PR_NUMBER/head"` | Install package from GitHub pull request | +| pipu | `pip install --upgrade` | Upgrade packages | +| pipun | `pip uninstall` | Uninstall packages | +| pipgi | `pip freeze \| grep` | Grep through installed packages | +| piplo | `pip list --outdated` | List outdated packages | +| pipreq | `pip freeze > requirements.txt` | Create requirements file | +| pipir | `pip install -r requirements.txt` | Install packages from `requirements.txt` file | +| pipupall | `pip list --outdated \| awk 'NR > 2 { print $1 }' \| xargs pip install --upgrade` | Update all installed packages | +| pipunall | `pip list --format freeze \| cut -d= -f1 \| xargs pip uninstall` | Uninstall all installed packages | From 62afbdebb96bf91c044a92b75d86f85a67da67a7 Mon Sep 17 00:00:00 2001 From: Cyril Plisko Date: Tue, 6 May 2025 18:27:04 +0300 Subject: [PATCH 28/82] feat(jj): add `jjgfa` alias (#13105) --- plugins/jj/README.md | 1 + plugins/jj/jj.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/jj/README.md b/plugins/jj/README.md index cd43ed11b..541b8f907 100644 --- a/plugins/jj/README.md +++ b/plugins/jj/README.md @@ -20,6 +20,7 @@ plugins=(... jj) | jje | `jj edit` | | jjgcl | `jj git clone` | | jjgf | `jj git fetch` | +| jjgfa | `jj git fetch --all-remotes` | | jjgp | `jj git push` | | jjl | `jj log` | | jjla | `jj log -r "all()"` | diff --git a/plugins/jj/jj.plugin.zsh b/plugins/jj/jj.plugin.zsh index 06c04958b..825460517 100644 --- a/plugins/jj/jj.plugin.zsh +++ b/plugins/jj/jj.plugin.zsh @@ -42,6 +42,7 @@ alias jjds='jj desc' alias jje='jj edit' alias jjgcl='jj git clone' alias jjgf='jj git fetch' +alias jjgfa='jj git fetch --all-remotes' alias jjgp='jj git push' alias jjl='jj log' alias jjla='jj log -r "all()"' From 3f8ea81b89cda583acea098c9b7353c295619d4d Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 11 May 2025 11:06:03 +0200 Subject: [PATCH 29/82] feat(z): update to cf9225fe (#13115) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/z/LICENSE | 2 +- plugins/z/z.plugin.zsh | 13 +++++++++++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 70f3d03da..23168b91a 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -38,7 +38,7 @@ dependencies: plugins/z: branch: master repo: agkozak/zsh-z - version: dd94ef04acc41748ba171eb219971cb455e0040b + version: cf9225feebfae55e557e103e95ce20eca5eff270 precopy: | set -e test -e README.md && mv -f README.md MANUAL.md diff --git a/plugins/z/LICENSE b/plugins/z/LICENSE index 162cba8d1..b36aeb408 100644 --- a/plugins/z/LICENSE +++ b/plugins/z/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018-2024 Alexandros Kozak +Copyright (c) 2018-2025 Alexandros Kozak Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/plugins/z/z.plugin.zsh b/plugins/z/z.plugin.zsh index bf15b01de..39b832292 100644 --- a/plugins/z/z.plugin.zsh +++ b/plugins/z/z.plugin.zsh @@ -4,7 +4,7 @@ # # https://github.com/agkozak/zsh-z # -# Copyright (c) 2018-2024 Alexandros Kozak +# Copyright (c) 2018-2025 Alexandros Kozak # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -294,7 +294,16 @@ zshz() { owner=${ZSHZ_OWNER:-${_Z_OWNER}} if (( ZSHZ[USE_FLOCK] )); then - ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || ${ZSHZ[RM]} -f "$tempfile" + # An unsual case: if inside Docker container where datafile could be bind + # mounted + if [[ -r '/proc/1/cgroup' && "$(< '/proc/1/cgroup')" == *docker* ]]; then + print "$(< "$tempfile")" > "$datafile" 2> /dev/null + ${ZSHZ[RM]} -f "$tempfile" + # All other cases + else + ${ZSHZ[MV]} "$tempfile" "$datafile" 2> /dev/null || + ${ZSHZ[RM]} -f "$tempfile" + fi if [[ -n $owner ]]; then ${ZSHZ[CHOWN]} ${owner}:"$(id -ng ${owner})" "$datafile" From c34c1da736f4f162206e1153e66850788f3e2e16 Mon Sep 17 00:00:00 2001 From: Lorenzo Bettini Date: Mon, 12 May 2025 09:56:26 +0200 Subject: [PATCH 30/82] docs(vi-mode): explaination for text objects (#13116) --- plugins/vi-mode/README.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/plugins/vi-mode/README.md b/plugins/vi-mode/README.md index 6e781f296..bc78cfa3d 100644 --- a/plugins/vi-mode/README.md +++ b/plugins/vi-mode/README.md @@ -46,7 +46,7 @@ hasn't been defined by theme, *Insert mode* is not displayed by default. You can change these indicators by setting the `MODE_INDICATOR` (*Normal mode*) and `INSERT_MODE_INDICATORS` (*Insert mode*) variables. -This settings support Prompt Expansion sequences. For example: +These settings support Prompt Expansion sequences. For example: ```zsh MODE_INDICATOR="%F{white}+%f" @@ -157,6 +157,27 @@ NOTE: delete/kill commands (`dd`, `D`, `c{motion}`, `C`, `x`,`X`) and yank comma (`y`, `Y`) will copy to the clipboard. Contents can then be put back using paste commands (`P`, `p`). +## Text objects + +Standard text objects are supported with `i` ("inside") and `a` ("around"), e.g., for words; thus, you can select the word the cursor is in with `viw`, or delete the current word, including surrounding spaces, with `daw`. + +For other text objects, you can rely on the built-in functionality of Zsh and enable it accordingly. +For example, for quoted strings, you can copy the commented snippet of : place this in your `.zsrhc` file, e.g., after sourcing oh-my-zsh: + +```sh +autoload -U select-quoted +zle -N select-quoted +for m in visual viopp; do + for c in {a,i}{\',\",\`}; do + bindkey -M $m $c select-quoted + done +done +``` + +Now, in normal mode, you can select everything inside a double-quoted string with `vi"`. +Note that this works even if you're not already inside a quoted string. +For example, you can replace everything inside a single-quoted string in the current line, from wherever the cursor is, with `ci'`. + ## Known issues ### Low `$KEYTIMEOUT` From c95509ebfdbcc3c497f12697cfd2717bcb0a528b Mon Sep 17 00:00:00 2001 From: Igor Aleksandrov Date: Thu, 15 May 2025 01:48:50 +0400 Subject: [PATCH 31/82] feat(kamal): add autocomplete support and aliases for Kamal (https://kamal-deploy.org/) (#13080) --- plugins/kamal/README.md | 16 + plugins/kamal/_kamal | 691 +++++++++++++++++++++++++++++++++ plugins/kamal/kamal.plugin.zsh | 25 ++ 3 files changed, 732 insertions(+) create mode 100644 plugins/kamal/README.md create mode 100644 plugins/kamal/_kamal create mode 100644 plugins/kamal/kamal.plugin.zsh diff --git a/plugins/kamal/README.md b/plugins/kamal/README.md new file mode 100644 index 000000000..af5716826 --- /dev/null +++ b/plugins/kamal/README.md @@ -0,0 +1,16 @@ +# Kamal + +This plugin provides completion for [Kamal](https://kamal-deploy.org/) as well as some +aliases for frequent Kamal commands. + +To use it, add kamal to the plugins array of your zshrc file: + +```zsh +plugins=(... kamal) +``` + +## Aliase + +| Alias | Command | Description | +|-----------|----------------------------------|----------------------------------------------------------------------------------| +| kad | `kamal deploy` | Deploy app to servers | diff --git a/plugins/kamal/_kamal b/plugins/kamal/_kamal new file mode 100644 index 000000000..52b29e814 --- /dev/null +++ b/plugins/kamal/_kamal @@ -0,0 +1,691 @@ +#compdef kamal + +# Description +# ----------- +# zsh completion for Kamal (https://kamal-deploy.org/) +# ------------------------------------------------------------------------- +# Authors +# ------- +# * Igor Aleksandrov +# ------------------------------------------------------------------------- +# Inspiration +# ----------- +# * docker-compose ohmyzsh completion script by @sdurrheimer Steve Durrheimer +# ------------------------------------------------------------------------- + +# _kamal_commands() { +# # Only initialize if empty +# if (( ${#kamal_commands} == 0 )); then +# kamal_commands=( +# accessory +# app +# audit +# build +# config +# deploy +# details +# docs +# help +# init +# lock +# proxy +# prune +# redeploy +# registry +# remove +# rollback +# secrets +# server +# setup +# upgrade +# version +# ) +# fi + +# _values 'Kamal commands' $kamal_commands +# } + +typeset -gr _kamal_commands=( + 'accessory:Control accessory services' + 'app:Control application deployment' + 'audit:Audit security of deployment' + 'build:Build and manage app images' + 'config:Show effective configuration' + 'deploy:Deploy app to servers' + 'details:Show details about deployment' + 'docs:Open documentation in browser' + 'help:Show command help' + 'init:Initialize new Kamal project' + 'lock:Manage deployment locks' + 'proxy:Control reverse proxy' + 'prune:Clean up containers and images' + 'redeploy:Redeploy current version' + 'registry:Manage Docker registry access' + 'remove:Remove app from servers' + 'rollback:Rollback to a previous version' + 'secrets:Manage deployment secrets' + 'server:Control server configuration' + 'setup:Setup initial deployment' + 'upgrade:Upgrade deployment' + 'version:Show Kamal version' +) + +# Helper function to display messages +_kamal_message() { + local msg="$1" + _kamal_message "==> $msg" +} + +# Helper function to extract destination names from ./config/deploy.*.yml +_kamal_destinations() { + local -a dests + local file + + # Check if config directory exists + if [[ ! -d "config" ]]; then + _kamal_message "Cannot find Kamal configuration directory at ./config" && return 1 + fi + + for file in config/deploy.*.yml(N); do + [[ $file =~ config/deploy\.(.+)\.yml ]] && dests+=("${match[1]}") + done + + _values 'Destination' $dests +} + +# Define global _kamal_flags array +typeset -ga _kamal_flags +_kamal_flags=( + '(-v --verbose )'{-v,--verbose}'[Detailed logging]' + '(--no-verbose --skip-verbose)'{--no-verbose,--skip-verbose}'[No detailed logging]' + '(-q --quiet --no-quiet --skip-quiet)'{-q,--quiet}'[Minimal logging]' + '(-q --quiet --no-quiet --skip-quiet)'{--no-quiet,--skip-quiet}'[No minimal logging]' + '--version=[Run commands against a specific app version]:version' + '(-p --primary --no-primary --skip-primary)'{-p,--primary}'[Run commands only on primary host instead of all]' + '(-p --primary --no-primary --skip-primary)'{--no-primary,--skip-primary}'[Do not run commands only on primary host]' + '(-h --hosts)'{-h,--hosts=}'[Run commands on these hosts instead of all]:hosts' + '(-r --roles)'{-r,--roles=}'[Run commands on these roles instead of all]:roles' + '(-c --config-file)'{-c,--config-file=}'[Path to config file]:config file:_files' + '(-d --destination)'{-d,--destination=}'[Specify destination to be used for config file]:destination:_kamal_destinations' + '(-H --skip-hooks)'{-H,--skip-hooks}'[Do not run hooks]' +) + +_kamal() { + local context state state_descr line curcontext="$curcontext" + typeset -A opt_args + + local ret=1 + + _arguments -C \ + $_kamal_flags \ + '1: :->command' \ + '*:: :->args' && ret=0 + + case $state in + (command) + # First argument - show available commands + _describe -t kamal-commands "Kamal commands" _kamal_commands && ret=0 + ;; + (args) + # Subsequent arguments - handle based on the command + case $words[1] in + (accessory) + _kamal_accessory && ret=0 + ;; + (app) + _kamal_app && ret=0 + ;; + (audit) + _arguments $_kamal_flags && ret=0 + ;; + (build) + _kamal_build && ret=0 + ;; + (config) + _arguments $_kamal_flags && ret=0 + ;; + (deploy) + _arguments $_kamal_flags && ret=0 + ;; + (details) + _arguments $_kamal_flags && ret=0 + ;; + (docs) + _arguments $_kamal_flags && ret=0 + ;; + (help) + _kamal_help && ret=0 + ;; + (init) + local -a init_flags + init_flags=( + $_kamal_flags + '(--bundle --no-bundle --skip-bundle)--bundle[Add Kamal to the Gemfile and create a bin/kamal binstub]' + '(--bundle --no-bundle --skip-bundle)--no-bundle[Do not add Kamal to the Gemfile and create a bin/kamal binstub]' + '(--bundle --no-bundle --skip-bundle)--skip-bundle[Skip add Kamal to the Gemfile and create a bin/kamal binstub]' + ) + _arguments $init_flags && ret=0 + ;; + (lock) + _kamal_lock && ret=0 + ;; + (proxy) + _kamal_proxy && ret=0 + ;; + (prune) + _kamal_prune && ret=0 + ;; + (redeploy) + _arguments $_kamal_flags && ret=0 + ;; + (registry) + _kamal_registry && ret=0 + ;; + (remove) + local -a remove_flags + remove_flags=( + $_kamal_flags + '(-y --confirmed --no-confirmed --skip-confirmed)'{-y,--confirmed}'[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--no-confirmed[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--skip-confirmed[Proceed without confirmation question]' + ) + _arguments $remove_flags && ret=0 + ;; + (rollback) + if (( CURRENT == 2 )); then + _kamal_message "Enter the version to rollback to" && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (secrets) + _kamal_secrets && ret=0 + ;; + (server) + _kamal_server && ret=0 + ;; + (setup) + local -a setup_flags + setup_flags=( + $_kamal_flags + '(-P --skip-push)'{-P,--skip-push}'[Skip image build and push]' + ) + _arguments $setup_flags && ret=0 + ;; + (upgrade) + local -a upgrade_flags + upgrade_flags=( + $_kamal_flags + '(-y --confirmed --no-confirmed --skip-confirmed)'{-y,--confirmed}'[Proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--no-confirmed[Do not proceed without confirmation question]' + '(-y --confirmed --no-confirmed --skip-confirmed)--skip-confirmed[Skip confirmation question]' + '(--rolling --no-rolling --skip-rolling)--rolling[Upgrade one host at a time]' + '(--rolling --no-rolling --skip-rolling)--no-rolling[Do not upgrade one host at a time]' + '(--rolling --no-rolling --skip-rolling)--skip-rolling[Skip rolling upgrade]' + ) + _arguments $upgrade_flags && ret=0 + ;; + (version) + _arguments $_kamal_flags && ret=0 + esac + ;; + esac + + return ret +} + +_kamal_accessory() { + local context state line + typeset -A opt_args + local ret=1 + + # Define accessory subcommands + local -a accessory_subcommands + accessory_subcommands=( + "boot:Boot new accessory service on host (use NAME=all to boot all accessories)" + "details:Show details about accessory on host (use NAME=all to show all accessories)" + "exec:Execute a custom command on servers within the accessory container (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + "logs:Show log lines from accessory on host (use --help to show options)" + "reboot:Reboot existing accessory on host (stop container, remove container, start new container; use NAME=all to boot all accessories)" + "remove:Remove accessory container, image and data directory from host (use NAME=all to remove all accessories)" + "restart:Restart existing accessory container on host" + "start:Start existing accessory container on host" + "stop:Stop existing accessory container on host" + "upgrade:Upgrade accessories from Kamal 1.x to 2.0 (restart them in 'kamal' network)" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t accessory-commands "Kamal accessory commands" accessory_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|details|exec|logs|reboot|remove|restart|start|stop) + # These commands require a NAME parameter + if (( CURRENT == 2 )); then + # At the NAME position - we could add accessory name completion here + # if we had a way to list available accessories + _kamal_message "Specify an accessory name (or 'all' for all accessories)" && ret=0 + elif [[ "$words[1]" == "exec" && CURRENT == 3 ]]; then + # For exec, the 3rd argument is a command + _kamal_message "Enter a command to execute" && ret=0 + elif (( CURRENT > 2 )) && [[ "$words[1]" != "exec" || CURRENT > 3 ]]; then + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + accessory_subcommands=("${(@)accessory_subcommands:#help*}") + _describe -t accessory-help-commands "Kamal accessory help commands" accessory_subcommands + ;; + (upgrade) + # For upgrade, show flags immediately + _arguments $_kamal_flags && ret=0 + ;; + esac + ;; + esac + + return ret +} + +_kamal_app() { + local context state line + typeset -A opt_args + local ret=1 + + local -a app_subcommands + app_subcommands=( + "boot:Boot app on servers (or reboot app if already running)" + "containers:Show app containers on servers" + "details:Show details about app containers" + "exec:Execute a custom command on servers within the app container (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + "images:Show app images on servers" + "logs:Show log lines from app on servers (use --help to show options)" + "remove:Remove app containers and images from servers" + "stale_containers:Detect app stale containers" + "start:Start existing app container on servers" + "stop:Stop app container on servers" + "version:Show app version currently running on servers" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t app-commands "Kamal app commands" app_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|containers|details|images|logs|remove|stale_containers|start|stop) + _arguments $_kamal_flags && ret=0 + ;; + (exec) + # For exec, the next argument is a command + if (( CURRENT == 2 )); then + _kamal_message "Enter a command to execute" && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + app_subcommands=("${(@)app_subcommands:#help*}") + _describe -t app-help-commands "Kamal app help commands" app_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_build() { + local context state line + typeset -A opt_args + local ret=1 + + local -a build_subcommands + build_subcommands=( + "create:Create a build setup" + "deliver:Build app and push app image to registry then pull image on servers" + "details:Show build setup" + "dev:Build using the working directory, tag it as dirty, and push to local image store." + "help:Describe subcommands or one specific subcommand" + "pull:Pull app image from registry onto servers" + "push:Build and push app image to registry" + "remove:Remove build setup" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t build-commands "Kamal build commands" build_subcommands && ret=0 + ;; + (args) + case $words[1] in + (create|deliver|details|dev|pull|push|remove) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + build_subcommands=("${(@)build_subcommands:#help*}") + _describe -t build-help-commands "Kamal build help commands" build_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_help() { + local ret=1 + + # Make sure kamal_commands is initialized properly + # if (( ${#kamal_commands} == 0 )); then + # _kamal_commands >/dev/null + # fi + + # If we already have a command after "help", return without suggestions + if (( CURRENT > 2 )); then + ret=0 + else + local -a help_commands + # Filter out help from the list of commands + help_commands=("${(@)_kamal_commands:#help}") + + _values 'Kamal help' $help_commands && ret=0 + fi + + return ret +} + +_kamal_lock() { + local context state line + typeset -A opt_args + local ret=1 + + local -a lock_subcommands + lock_subcommands=( + "acquire:Acquire the deploy lock" + "help:Describe subcommands or one specific subcommand" + "release:Release the deploy lock" + "status:Report lock status" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t lock-commands "Kamal lock commands" lock_subcommands && ret=0 + ;; + (args) + case $words[1] in + (acquire) + local -a acquire_flags + acquire_flags=( + $_kamal_flags + '(-m --message)'{-m,--message=}'[A lock message]:message:' # Required flag + ) + _arguments $acquire_flags && ret=0 + ;; + (release|status) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + lock_subcommands=("${(@)lock_subcommands:#help*}") + _describe -t lock-help-commands "Kamal lock help commands" lock_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_proxy() { + local context state line + typeset -A opt_args + local ret=1 + + local -a proxy_subcommands + proxy_subcommands=( + "boot:Boot proxy on servers" + "boot_config:Manage kamal-proxy boot configuration" + "details:Show details about proxy container from servers" + "help:Describe subcommands or one specific subcommand" + "logs:Show log lines from proxy on servers" + "reboot:Reboot proxy on servers (stop container, remove container, start new container)" + "remove:Remove proxy container and image from servers" + "restart:Restart existing proxy container on servers" + "start:Start existing proxy container on servers" + "stop:Stop existing proxy container on servers" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t proxy-commands "Kamal proxy commands" proxy_subcommands && ret=0 + ;; + (args) + case $words[1] in + (boot|details|logs|reboot|remove|restart|start|stop) + _arguments $_kamal_flags && ret=0 + ;; + (boot_config) + if (( CURRENT == 2 )); then + local -a boot_config_commands=( + "set:Set boot configuration" + "get:Get boot configuration" + "reset:Reset boot configuration" + ) + _describe -t boot-config-commands "Boot config commands" boot_config_commands && ret=0 + else + _values $_kamal_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + proxy_subcommands=("${(@)proxy_subcommands:#help*}") + _describe -t proxy-help-commands "Kamal proxy help commands" proxy_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_prune() { + local context state line + typeset -A opt_args + local ret=1 + + local -a prune_subcommands + prune_subcommands=( + "all:Prune unused images and stopped containers" + "containers:Prune all stopped containers, except the last n (default 5)" + "help:Describe subcommands or one specific subcommand" + "images:Prune unused images" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t prune-commands "Kamal prune commands" prune_subcommands && ret=0 + ;; + (args) + case $words[1] in + (all|containers|images) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + prune_subcommands=("${(@)prune_subcommands:#help*}") + _describe -t prune-help-commands "Kamal prune help commands" prune_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_registry() { + local context state line + typeset -A opt_args + local ret=1 + + local -a registry_subcommands + registry_subcommands=( + "help:Describe subcommands or one specific subcommand" + "login:Log in to registry locally and remotely" + "logout:Log out of registry locally and remotely" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t registry-commands "Kamal registry commands" registry_subcommands && ret=0 + ;; + (args) + case $words[1] in + (help) + # Remove help itself from the list of commands + registry_subcommands=("${(@)registry_subcommands:#help*}") + _describe -t registry-help-commands "Kamal registry help commands" registry_subcommands + ;; + (login|logout) + _arguments $_kamal_flags && ret=0 + ;; + esac + ;; + esac + + return ret +} + +_kamal_secrets() { + local context state line + typeset -A opt_args + local ret=1 + + local -a secrets_subcommands + secrets_subcommands=( + "extract:Extract a single secret from the results of a fetch call" + "fetch:Fetch secrets from a vault" + "help:Describe subcommands or one specific subcommand" + "print:Print the secrets (for debugging)" + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t secrets-commands "Kamal secrets commands" secrets_subcommands && ret=0 + ;; + (args) + case $words[1] in + (fetch) + local -a fetch_flags + fetch_flags=( + $_kamal_flags + '(-a --adapter)'{-a,--adapter=}'[Secret storage adapter]:adapter:(aws-parameter-store)' + ) + _arguments $fetch_flags && ret=0 + ;; + (extract|print) + _arguments $_kamal_flags && ret=0 + ;; + (help) + # Remove help itself from the list of commands + secrets_subcommands=("${(@)secrets_subcommands:#help*}") + _describe -t secrets-help-commands "Kamal secrets help commands" secrets_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal_server() { + local context state line + typeset -A opt_args + local ret=1 + + local -a server_subcommands + server_subcommands=( + "bootstrap:Set up Docker to run Kamal apps" + "exec:Run a custom command on the server (use --help to show options)" + "help:Describe subcommands or one specific subcommand" + ) + + local -a server_flags + server_flags=( + $_kamal_flags + '(-i --interactive --no-interactive --skip-interactive)'{-i,--interactive}'[Run the command interactively]' + '(-i --interactive --no-interactive --skip-interactive)--no-interactive[Do not run the command interactively]' + '(-i --interactive --no-interactive --skip-interactive)--skip-interactive[Skip interactive mode]' + ) + + _arguments -C \ + '1: :->subcmd' \ + '*:: :->args' && ret=0 + + case $state in + (subcmd) + _describe -t server-commands "Kamal server commands" server_subcommands && ret=0 + ;; + (args) + case $words[1] in + (bootstrap) + _arguments $server_flags && ret=0 + ;; + (exec) + if (( CURRENT == 2 )); then + # For exec, the next argument is a command + _kamal_message "Enter a command to execute" && ret=0 + else + _values $server_flags && ret=0 + fi + ;; + (help) + # Remove help itself from the list of commands + server_subcommands=("${(@)server_subcommands:#help*}") + _describe -t server-help-commands "Kamal server help commands" server_subcommands + ;; + esac + ;; + esac + + return ret +} + +_kamal "$@" \ No newline at end of file diff --git a/plugins/kamal/kamal.plugin.zsh b/plugins/kamal/kamal.plugin.zsh new file mode 100644 index 000000000..e21ab4f92 --- /dev/null +++ b/plugins/kamal/kamal.plugin.zsh @@ -0,0 +1,25 @@ +# Find kamal binary (local ./bin/kamal or global) +function _kamal_command () { + if [ -x "./bin/kamal" ]; then + ./bin/kamal "$@" + else + command kamal "$@" + fi +} + +function which-kamal() { + if [ -x "./bin/kamal" ]; then + echo "Using local ./bin/kamal" + else + echo "Using global $(command -v kamal)" + fi +} + +# Use `_kamal_command`` function for `kamal` command +alias kamal='_kamal_command' + +# Aliases +alias kad='kamal deploy' + +# Hook up completion +compdef _kamal_command=kamal From 881c8b78d3e3ade9bccfddb3e616842807d07a59 Mon Sep 17 00:00:00 2001 From: tobii-dev <77458451+tobii-dev@users.noreply.github.com> Date: Sun, 18 May 2025 19:14:44 +0200 Subject: [PATCH 32/82] feat(termsupport): add WezTerm support (#13121) Co-authored-by: Carlo Sala --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index d2fbf42cd..994c9c322 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -17,7 +17,7 @@ function title { : ${2=$1} case "$TERM" in - cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty*|st*|foot*|contour*) + cygwin|xterm*|putty*|rxvt*|konsole*|ansi|mlterm*|alacritty*|st*|foot*|contour*|wezterm*) print -Pn "\e]2;${2:q}\a" # set window name print -Pn "\e]1;${1:q}\a" # set tab name ;; From 40c2a72e03b1df100b3937dd44a9754f17c06c6d Mon Sep 17 00:00:00 2001 From: Kirill Fedorov Date: Thu, 22 May 2025 12:23:50 +0300 Subject: [PATCH 33/82] fix(history): handle HIST_STAMPS with whitespace in timestamp format (#13099) Co-authored-by: Kirill Fedorov --- lib/history.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/history.zsh b/lib/history.zsh index 35da57de2..781a0e9de 100644 --- a/lib/history.zsh +++ b/lib/history.zsh @@ -18,10 +18,10 @@ function omz_history { print -u2 History file deleted. elif [[ $# -eq 0 ]]; then # if no arguments provided, show full history starting from 1 - builtin fc $stamp -l 1 + builtin fc "${stamp[@]}" -l 1 else # otherwise, run `fc -l` with a custom format - builtin fc $stamp -l "$@" + builtin fc "${stamp[@]}" -l "$@" fi } From 0354add542b6d769dbe39e10eb0caa0a11b2b716 Mon Sep 17 00:00:00 2001 From: G'lek Tarssza Date: Thu, 22 May 2025 03:27:34 -0600 Subject: [PATCH 34/82] fix(blinks)!: use `default` instead of `black` color (#13123) --- themes/blinks.zsh-theme | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/blinks.zsh-theme b/themes/blinks.zsh-theme index ddb32f7c3..736683c9a 100644 --- a/themes/blinks.zsh-theme +++ b/themes/blinks.zsh-theme @@ -11,11 +11,11 @@ function _prompt_char() { # This theme works with both the "dark" and "light" variants of the # Solarized color schema. Set the SOLARIZED_THEME variable to one of # these two values to choose. If you don't specify, we'll assume you're -# using the "dark" variant. +# using neither variant. case ${SOLARIZED_THEME:-dark} in light) bkg=white;; - *) bkg=black;; + *) bkg=default;; esac ZSH_THEME_GIT_PROMPT_PREFIX=" [%{%B%F{blue}%}" From 1ed17ac0523ebc4d12e4e5324fd5f5ce5dafc668 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Ahlstr=C3=B6m?= <71292737+kahlstrm@users.noreply.github.com> Date: Fri, 23 May 2025 16:43:53 +0300 Subject: [PATCH 35/82] feat(terraform): add `init -reconfigure` aliases` (#13129) --- plugins/terraform/README.md | 39 +++++++++++++------------- plugins/terraform/terraform.plugin.zsh | 2 ++ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/plugins/terraform/README.md b/plugins/terraform/README.md index feaf21d40..6c139ac51 100644 --- a/plugins/terraform/README.md +++ b/plugins/terraform/README.md @@ -15,25 +15,26 @@ plugins=(... terraform) ## Aliases -| Alias | Command | -|---------|----------------------------------| -| `tf` | `terraform` | -| `tfa` | `terraform apply` | -| `tfaa` | `terraform apply -auto-approve` | -| `tfc` | `terraform console` | -| `tfd` | `terraform destroy` | -| `tfd!` | `terraform destroy -auto-approve`| -| `tff` | `terraform fmt` | -| `tffr` | `terraform fmt -recursive` | -| `tfi` | `terraform init` | -| `tfiu` | `terraform init -upgrade` | -| `tfo` | `terraform output` | -| `tfp` | `terraform plan` | -| `tfv` | `terraform validate` | -| `tfs` | `terraform state` | -| `tft` | `terraform test` | -| `tfsh` | `terraform show` | - +| Alias | Command | +| ------- | -------------------------------------- | +| `tf` | `terraform` | +| `tfa` | `terraform apply` | +| `tfaa` | `terraform apply -auto-approve` | +| `tfc` | `terraform console` | +| `tfd` | `terraform destroy` | +| `tfd!` | `terraform destroy -auto-approve` | +| `tff` | `terraform fmt` | +| `tffr` | `terraform fmt -recursive` | +| `tfi` | `terraform init` | +| `tfir` | `terraform init -reconfigure` | +| `tfiu` | `terraform init -upgrade` | +| `tfiur` | `terraform init -upgrade -reconfigure` | +| `tfo` | `terraform output` | +| `tfp` | `terraform plan` | +| `tfv` | `terraform validate` | +| `tfs` | `terraform state` | +| `tft` | `terraform test` | +| `tfsh` | `terraform show` | ## Prompt function diff --git a/plugins/terraform/terraform.plugin.zsh b/plugins/terraform/terraform.plugin.zsh index 046fabb03..0982fa193 100644 --- a/plugins/terraform/terraform.plugin.zsh +++ b/plugins/terraform/terraform.plugin.zsh @@ -24,7 +24,9 @@ alias 'tfd!'='terraform destroy -auto-approve' alias tff='terraform fmt' alias tffr='terraform fmt -recursive' alias tfi='terraform init' +alias tfir='terraform init -reconfigure' alias tfiu='terraform init -upgrade' +alias tfiur='terraform init -upgrade -reconfigure' alias tfo='terraform output' alias tfp='terraform plan' alias tfv='terraform validate' From d39804a5a6ba208159356b6ecd8308b559c588d0 Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Sat, 24 May 2025 10:30:14 +0300 Subject: [PATCH 36/82] docs(universalarchive): expand documentation (#13136) --- plugins/universalarchive/README.md | 88 ++++++++++++++++++++---------- 1 file changed, 59 insertions(+), 29 deletions(-) diff --git a/plugins/universalarchive/README.md b/plugins/universalarchive/README.md index 93a1bd9fc..bcd33cea0 100644 --- a/plugins/universalarchive/README.md +++ b/plugins/universalarchive/README.md @@ -1,46 +1,76 @@ # universalarchive plugin -Lets you compress files by a command `ua `, supporting various -compression formats (e.g. 7z, tar.gz, lzma, ...). +The `universalarchive` plugin provides a convenient command-line interface for archiving files and directories using a wide variety of compression formats - without having to remember the exact syntax for each tool. -To enable it, add `universalarchive` to the plugins array in your zshrc file: +To enable it, add `universalarchive` to the plugins array in your `.zshrc` file: ```zsh plugins=(... universalarchive) ``` +## Features + - Compress files and directories using a simple, unified command: ua + - Automatically detects file/directory names to generate appropriate output names + - Supports fallback naming if an output file already exists + - Works with many common and advanced compression formats + - Designed for simplicity and quick use in the terminal + ## Usage -Run `ua ` to compress `` into an archive file using ``. -For example: - +Basic command format: ```sh -ua xz *.html +ua +``` +- ``: the archive format to use (e.g., `zip`, `tar.gz`, `xz`, `7z`, etc.) +- ``: one or more files or directories to compress + +## Examples: + +Compresses `notes.txt` and `images` into `notes.zip` +```sh +ua zip notes.txt images/ ``` -this command will compress all `.html` files in directory `folder` into `folder.xz`. +Creates `myproject.tar.gz` +```sh +ua tar.gz myproject/ +``` -This plugin saves you from having to remember which command line arguments compress a file. +Compresses all .log files into `current_folder.xz` +```sh +ua xz *.log +``` -## Supported compression formats +The plugin will generate a default archive filename based on the input: + - For a file, the output is derived from the file name without its extension. + - For a directory, it uses the directory name. + - For multiple files, it uses the name of the common parent directory. -| Extension | Description | -|:-----------------|:-------------------------------| -| `7z` | 7zip file | -| `bz2` | Bzip2 file | -| `gz` | Gzip file | -| `lzma` | LZMA archive | -| `lzo` | LZO archive | -| `rar` | WinRAR archive | -| `tar` | Tarball | -| `tbz`/`tar.bz2` | Tarball with bzip2 compression | -| `tgz`/`tar.gz` | Tarball with gzip compression | -| `tlz`/`tar.lzma` | Tarball with lzma compression | -| `txz`/`tar.xz` | Tarball with lzma2 compression | -| `tZ`/`tar.Z` | Tarball with LZW compression | -| `xz` | LZMA2 archive | -| `Z` | Z archive (LZW) | -| `zip` | Zip archive | -| `zst` | Zstd archive | + If the output file already exists, a unique filename is generated using `mktemp`. -See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information regarding the archive formats. +## Supported Archive Formats + +| Format | Description | Tool Used | +|:-----------------|:-------------------------------|:-----------------| +| `7z` | 7zip archive | `7z` | +| `bz2` | Bzip2-compressed file | `bzip2` | +| `gz` | Gzip-compressed file | `gzip` | +| `lzma` | LZMA-compressed file | `lzma` | +| `lzo` | LZO-compressed file | `lzop` | +| `rar` | WinRAR archive | `rar` | +| `tar` | Uncompressed tarball | `tar` | +| `tbz`,`tar.bz2` | Tarball compressed with Bzip2 | `tar + bzip2` | +| `tgz`,`tar.gz` | Tarball compressed with Gzip | `tar + gzip` | +| `tlz`,`tar.lzma` | Tarball compressed with LZMA | `tar + lzma` | +| `txz`,`tar.xz` | Tarball compressed with LZMA2 | `tar + xz` | +| `tZ`,`tar.Z` | Tarball compressed with LZW | `tar + compress` | +| `xz` | XZ-compressed file | `xz` | +| `Z` | LZW-compressed file | `compress` | +| `zip` | Standard Zip archive | `zip` | +| `zst` | Zstandard-compressed file | `zstd` | + + > Note: Some formats may require specific tools to be installed on your system (e.g. `7z`, `rar`, `lzop`, `zstd`). Make sure these tools are available in your `$PATH`. + +## Auto-Completion + +The plugin provides tab-completion for supported formats and input files. Type `ua ` to see available formats, and `ua ` to browse files. From 13c702964c0287059a75eaec98cd71de51f4f19c Mon Sep 17 00:00:00 2001 From: Ilia Burtsev Date: Sat, 24 May 2025 13:39:17 +0300 Subject: [PATCH 37/82] fix(async): ensure `git_prompt_status` can be registered (#13134) --- lib/git.zsh | 198 ++++++++++++++++++++++++++-------------------------- 1 file changed, 99 insertions(+), 99 deletions(-) diff --git a/lib/git.zsh b/lib/git.zsh index a1b4d1587..f4d4229cb 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -39,6 +39,105 @@ function _omz_git_prompt_info() { echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } +function _omz_git_prompt_status() { + [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]] && return + + # Maps a git status prefix to an internal constant + # This cannot use the prompt constants, as they may be empty + local -A prefix_constant_map + prefix_constant_map=( + '\?\? ' 'UNTRACKED' + 'A ' 'ADDED' + 'M ' 'MODIFIED' + 'MM ' 'MODIFIED' + ' M ' 'MODIFIED' + 'AM ' 'MODIFIED' + ' T ' 'MODIFIED' + 'R ' 'RENAMED' + ' D ' 'DELETED' + 'D ' 'DELETED' + 'UU ' 'UNMERGED' + 'ahead' 'AHEAD' + 'behind' 'BEHIND' + 'diverged' 'DIVERGED' + 'stashed' 'STASHED' + ) + + # Maps the internal constant to the prompt theme + local -A constant_prompt_map + constant_prompt_map=( + 'UNTRACKED' "$ZSH_THEME_GIT_PROMPT_UNTRACKED" + 'ADDED' "$ZSH_THEME_GIT_PROMPT_ADDED" + 'MODIFIED' "$ZSH_THEME_GIT_PROMPT_MODIFIED" + 'RENAMED' "$ZSH_THEME_GIT_PROMPT_RENAMED" + 'DELETED' "$ZSH_THEME_GIT_PROMPT_DELETED" + 'UNMERGED' "$ZSH_THEME_GIT_PROMPT_UNMERGED" + 'AHEAD' "$ZSH_THEME_GIT_PROMPT_AHEAD" + 'BEHIND' "$ZSH_THEME_GIT_PROMPT_BEHIND" + 'DIVERGED' "$ZSH_THEME_GIT_PROMPT_DIVERGED" + 'STASHED' "$ZSH_THEME_GIT_PROMPT_STASHED" + ) + + # The order that the prompt displays should be added to the prompt + local status_constants + status_constants=( + UNTRACKED ADDED MODIFIED RENAMED DELETED + STASHED UNMERGED AHEAD BEHIND DIVERGED + ) + + local status_text + status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)" + + # Don't continue on a catastrophic failure + if [[ $? -eq 128 ]]; then + return 1 + fi + + # A lookup table of each git status encountered + local -A statuses_seen + + if __git_prompt_git rev-parse --verify refs/stash &>/dev/null; then + statuses_seen[STASHED]=1 + fi + + local status_lines + status_lines=("${(@f)${status_text}}") + + # If the tracking line exists, get and parse it + if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then + local branch_statuses + branch_statuses=("${(@s/,/)match}") + for branch_status in $branch_statuses; do + if [[ ! $branch_status =~ "(behind|diverged|ahead) ([0-9]+)?" ]]; then + continue + fi + local last_parsed_status=$prefix_constant_map[$match[1]] + statuses_seen[$last_parsed_status]=$match[2] + done + fi + + # For each status prefix, do a regex comparison + for status_prefix in ${(k)prefix_constant_map}; do + local status_constant="${prefix_constant_map[$status_prefix]}" + local status_regex=$'(^|\n)'"$status_prefix" + + if [[ "$status_text" =~ $status_regex ]]; then + statuses_seen[$status_constant]=1 + fi + done + + # Display the seen statuses in the order specified + local status_prompt + for status_constant in $status_constants; do + if (( ${+statuses_seen[$status_constant]} )); then + local next_display=$constant_prompt_map[$status_constant] + status_prompt="$next_display$status_prompt" + fi + done + + echo $status_prompt +} + # Use async version if setting is enabled, or unset but zsh version is at least 5.0.6. # This avoids async prompt issues caused by previous zsh versions: # - https://github.com/ohmyzsh/ohmyzsh/issues/12331 @@ -246,105 +345,6 @@ function git_prompt_long_sha() { SHA=$(__git_prompt_git rev-parse HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER" } -function _omz_git_prompt_status() { - [[ "$(__git_prompt_git config --get oh-my-zsh.hide-status 2>/dev/null)" = 1 ]] && return - - # Maps a git status prefix to an internal constant - # This cannot use the prompt constants, as they may be empty - local -A prefix_constant_map - prefix_constant_map=( - '\?\? ' 'UNTRACKED' - 'A ' 'ADDED' - 'M ' 'MODIFIED' - 'MM ' 'MODIFIED' - ' M ' 'MODIFIED' - 'AM ' 'MODIFIED' - ' T ' 'MODIFIED' - 'R ' 'RENAMED' - ' D ' 'DELETED' - 'D ' 'DELETED' - 'UU ' 'UNMERGED' - 'ahead' 'AHEAD' - 'behind' 'BEHIND' - 'diverged' 'DIVERGED' - 'stashed' 'STASHED' - ) - - # Maps the internal constant to the prompt theme - local -A constant_prompt_map - constant_prompt_map=( - 'UNTRACKED' "$ZSH_THEME_GIT_PROMPT_UNTRACKED" - 'ADDED' "$ZSH_THEME_GIT_PROMPT_ADDED" - 'MODIFIED' "$ZSH_THEME_GIT_PROMPT_MODIFIED" - 'RENAMED' "$ZSH_THEME_GIT_PROMPT_RENAMED" - 'DELETED' "$ZSH_THEME_GIT_PROMPT_DELETED" - 'UNMERGED' "$ZSH_THEME_GIT_PROMPT_UNMERGED" - 'AHEAD' "$ZSH_THEME_GIT_PROMPT_AHEAD" - 'BEHIND' "$ZSH_THEME_GIT_PROMPT_BEHIND" - 'DIVERGED' "$ZSH_THEME_GIT_PROMPT_DIVERGED" - 'STASHED' "$ZSH_THEME_GIT_PROMPT_STASHED" - ) - - # The order that the prompt displays should be added to the prompt - local status_constants - status_constants=( - UNTRACKED ADDED MODIFIED RENAMED DELETED - STASHED UNMERGED AHEAD BEHIND DIVERGED - ) - - local status_text - status_text="$(__git_prompt_git status --porcelain -b 2> /dev/null)" - - # Don't continue on a catastrophic failure - if [[ $? -eq 128 ]]; then - return 1 - fi - - # A lookup table of each git status encountered - local -A statuses_seen - - if __git_prompt_git rev-parse --verify refs/stash &>/dev/null; then - statuses_seen[STASHED]=1 - fi - - local status_lines - status_lines=("${(@f)${status_text}}") - - # If the tracking line exists, get and parse it - if [[ "$status_lines[1]" =~ "^## [^ ]+ \[(.*)\]" ]]; then - local branch_statuses - branch_statuses=("${(@s/,/)match}") - for branch_status in $branch_statuses; do - if [[ ! $branch_status =~ "(behind|diverged|ahead) ([0-9]+)?" ]]; then - continue - fi - local last_parsed_status=$prefix_constant_map[$match[1]] - statuses_seen[$last_parsed_status]=$match[2] - done - fi - - # For each status prefix, do a regex comparison - for status_prefix in ${(k)prefix_constant_map}; do - local status_constant="${prefix_constant_map[$status_prefix]}" - local status_regex=$'(^|\n)'"$status_prefix" - - if [[ "$status_text" =~ $status_regex ]]; then - statuses_seen[$status_constant]=1 - fi - done - - # Display the seen statuses in the order specified - local status_prompt - for status_constant in $status_constants; do - if (( ${+statuses_seen[$status_constant]} )); then - local next_display=$constant_prompt_map[$status_constant] - status_prompt="$next_display$status_prompt" - fi - done - - echo $status_prompt -} - # Outputs the name of the current user # Usage example: $(git_current_user_name) function git_current_user_name() { From 526969cad351fe85ff4a9a3949736bc08de2b12d Mon Sep 17 00:00:00 2001 From: Jonas Geiregat <288105+jonas-grgt@users.noreply.github.com> Date: Sat, 24 May 2025 12:40:40 +0200 Subject: [PATCH 38/82] feat(mvn): add verify aliases (#13133) --- plugins/mvn/README.md | 2 ++ plugins/mvn/mvn.plugin.zsh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/mvn/README.md b/plugins/mvn/README.md index 4181fedc5..bcb26482e 100644 --- a/plugins/mvn/README.md +++ b/plugins/mvn/README.md @@ -33,6 +33,8 @@ if it's found, or the mvn command otherwise. | `mvnct` | `mvn clean test` | | `mvncv` | `mvn clean verify` | | `mvncvst` | `mvn clean verify -DskipTests` | +| `mvnv` | `mvn verify` | +| `mvnvst` | `mvn verify -DskipTests` | | `mvndp` | `mvn deploy` | | `mvndocs` | `mvn dependency:resolve -Dclassifier=javadoc` | | `mvndt` | `mvn dependency:tree` | diff --git a/plugins/mvn/mvn.plugin.zsh b/plugins/mvn/mvn.plugin.zsh index 7bffce36e..8477722b0 100644 --- a/plugins/mvn/mvn.plugin.zsh +++ b/plugins/mvn/mvn.plugin.zsh @@ -62,6 +62,8 @@ alias mvncp='mvn clean package' alias mvnct='mvn clean test' alias mvncv='mvn clean verify' alias mvncvst='mvn clean verify -DskipTests' +alias mvnv='mvn verify' +alias mvnvst='mvn verify -DskipTests' alias mvndp='mvn deploy' alias mvndocs='mvn dependency:resolve -Dclassifier=javadoc' alias mvndt='mvn dependency:tree' From ecdc1e722a9f458b3b5c4900403ee77848e1dba2 Mon Sep 17 00:00:00 2001 From: Hanashiko <129686115+Hanashiko@users.noreply.github.com> Date: Sat, 24 May 2025 13:42:44 +0300 Subject: [PATCH 39/82] docs(rsync): improve README (#13137) --- plugins/rsync/README.md | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/plugins/rsync/README.md b/plugins/rsync/README.md index 032ee7f3b..04d16c88b 100644 --- a/plugins/rsync/README.md +++ b/plugins/rsync/README.md @@ -1,16 +1,26 @@ # rsync -This plugin adds aliases for frequent [rsync](https://rsync.samba.org/) commands. +This plugin adds aliases for frequent [rsync](https://rsync.samba.org/) commands, simplifying file transfer and synchronization tasks. -To use it add `rsync` to the plugins array in you zshrc file. +To use it add `rsync` to the plugins array in you `.zshrc` file. ```zsh plugins=(... rsync) ``` -| Alias | Command | -| ------------------- | ------------------------------------------------ | -| *rsync-copy* | `rsync -avz --progress -h` | -| *rsync-move* | `rsync -avz --progress -h --remove-source-files` | -| *rsync-update* | `rsync -avzu --progress -h` | -| *rsync-synchronize* | `rsync -avzu --delete --progress -h` | +| Alias | Command | Description | +| ------------------- | ------------------------------------------------ | ------------| +| `rsync-copy` | `rsync -avz --progress -h` | Recursively copy files and directories, preserving permissions, timestamps, and symbolic links. Compression is enabled for faster transfers. Progress is displayed in a human-readable format. | +| `rsync-move` | `rsync -avz --progress -h --remove-source-files` | Same as rsync-copy, but removes the source files after a successful transfer (effectively performing a move). | +| `rsync-update` | `rsync -avzu --progress -h` | Like rsync-copy, but only updates files if the source is newer than the destination (or if the destination file is missing). | +| `rsync-synchronize` | `rsync -avzu --delete --progress -h` | Performs bidirectional-style sync: updates files as in rsync-update and deletes files in the destination that no longer exist in the source. Useful for directory synchronization. | + +Explanation of Flags: + - -a: Archive mode; preserves symbolic links, permissions, timestamps, etc. + - -v: Verbose; shows details of the transfer process. + - -z: Compress file data during transfer for efficiency. + - -u: Skip files that are newer on the receiver. + - --progress: Show progress during file transfer. + - -h: Output numbers in human-readable format (e.g., 1K, 234M). + - --remove-source-files: Deletes source files after they are copied (used in rsync-move). + - --delete: Deletes files in the destination that are not present in the source (used in rsync-synchronize). From 095ac3ca8f4c3a89a69ff3b45cb67346f76babbd Mon Sep 17 00:00:00 2001 From: G'lek Tarssza Date: Sat, 24 May 2025 04:44:24 -0600 Subject: [PATCH 40/82] feat(cli): add `--enabled` flag to `omz plugin list` (#13128) --- lib/cli.zsh | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/lib/cli.zsh b/lib/cli.zsh index 3b6308313..0b144e4e7 100644 --- a/lib/cli.zsh +++ b/lib/cli.zsh @@ -72,6 +72,10 @@ function _omz { local -aU plugins plugins=("$ZSH"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t) "$ZSH_CUSTOM"/plugins/*/{_*,*.plugin.zsh}(-.N:h:t)) _describe 'plugin' plugins ;; + plugin::list) + local -a opts + opts=('--enabled:List enabled plugins only') + _describe -o 'options' opts ;; theme::(set|use)) local -aU themes themes=("$ZSH"/themes/*.zsh-theme(-.N:t:r) "$ZSH_CUSTOM"/**/*.zsh-theme(-.N:r:gs:"$ZSH_CUSTOM"/themes/:::gs:"$ZSH_CUSTOM"/:::)) @@ -206,7 +210,7 @@ Available commands: disable Disable plugin(s) enable Enable plugin(s) info Get information of a plugin - list List all available Oh My Zsh plugins + list [--enabled] List Oh My Zsh plugins load Load plugin(s) EOF @@ -449,8 +453,21 @@ function _omz::plugin::info { function _omz::plugin::list { local -a custom_plugins builtin_plugins - custom_plugins=("$ZSH_CUSTOM"/plugins/*(-/N:t)) - builtin_plugins=("$ZSH"/plugins/*(-/N:t)) + + # If --enabled is provided, only list what's enabled + if [[ "$1" == "--enabled" ]]; then + local plugin + for plugin in "${plugins[@]}"; do + if [[ -d "${ZSH_CUSTOM}/plugins/${plugin}" ]]; then + custom_plugins+=("${plugin}") + elif [[ -d "${ZSH}/plugins/${plugin}" ]]; then + builtin_plugins+=("${plugin}") + fi + done + else + custom_plugins=("$ZSH_CUSTOM"/plugins/*(-/N:t)) + builtin_plugins=("$ZSH"/plugins/*(-/N:t)) + fi # If the command is being piped, print all found line by line if [[ ! -t 1 ]]; then From 6ef47526f852114209e36af87938075b4caa28e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20Gamboa?= Date: Mon, 26 May 2025 07:27:53 -0400 Subject: [PATCH 41/82] feat(laravel): add `db:wipe` alias (#13071) --- plugins/laravel/README.md | 1 + plugins/laravel/laravel.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/laravel/README.md b/plugins/laravel/README.md index d722770c9..c5375f270 100644 --- a/plugins/laravel/README.md +++ b/plugins/laravel/README.md @@ -21,6 +21,7 @@ plugins=(... laravel) | `pamfs` | `php artisan migrate:fresh --seed` | | `pamr` | `php artisan migrate:rollback` | | `pads` | `php artisan db:seed` | +| `padw` | `php artisan db:wipe` | ## Makers diff --git a/plugins/laravel/laravel.plugin.zsh b/plugins/laravel/laravel.plugin.zsh index ef462b13c..20a1c473e 100644 --- a/plugins/laravel/laravel.plugin.zsh +++ b/plugins/laravel/laravel.plugin.zsh @@ -12,6 +12,7 @@ alias pamf='php artisan migrate:fresh' alias pamfs='php artisan migrate:fresh --seed' alias pamr='php artisan migrate:rollback' alias pads='php artisan db:seed' +alias padw='php artisan db:wipe' # Makers alias pamm='php artisan make:model' From 658240f49816bd6ae1e693a383e26b703ef2d0fb Mon Sep 17 00:00:00 2001 From: mm503 <182180598+mm503@users.noreply.github.com> Date: Thu, 29 May 2025 02:33:01 -0500 Subject: [PATCH 42/82] feat(kubectl): add aliases for `get events` (#13147) --- plugins/kubectl/README.md | 238 +++++++++++++++-------------- plugins/kubectl/kubectl.plugin.zsh | 2 + 2 files changed, 122 insertions(+), 118 deletions(-) diff --git a/plugins/kubectl/README.md b/plugins/kubectl/README.md index 28a502d11..6f347a8ee 100644 --- a/plugins/kubectl/README.md +++ b/plugins/kubectl/README.md @@ -11,124 +11,126 @@ plugins=(... kubectl) ## Aliases -| Alias | Command | Description | -| :------- | :------------------------------------------------- | :----------------------------------------------------------------------------------------------- | -| k | `kubectl` | The kubectl command | -| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | -| kaf | `kubectl apply -f` | Apply a YML file | -| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | -| | | **Manage configuration quickly to switch contexts between local, dev and staging** | -| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | -| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | -| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | -| kccc | `kubectl config current-context` | Display the current-context | -| kcgc | `kubectl config get-contexts` | List of contexts available | -| | | **General aliases** | -| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | -| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | -| | | **Pod management** | -| kgp | `kubectl get pods` | List all pods in ps output format | -| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | -| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | -| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels | -| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | -| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | -| kep | `kubectl edit pods` | Edit pods from the default editor | -| kdp | `kubectl describe pods` | Describe all pods | -| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | -| | | **Service management** | -| kgs | `kubectl get svc` | List all services in ps output format | -| kgsw | `kgs --watch` | After listing all services, watch for changes | -| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | -| kes | `kubectl edit svc` | Edit services(svc) from the default editor | -| kds | `kubectl describe svc` | Describe all services in detail | -| kdels | `kubectl delete svc` | Delete all services matching passed argument | -| | | **Ingress management** | -| kgi | `kubectl get ingress` | List ingress resources in ps output format | -| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | -| kdi | `kubectl describe ingress` | Describe ingress resource in detail | -| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | -| | | **Namespace management** | -| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | -| kcn | `kubectl config set-context --current --namespace` | Change current namespace | -| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | -| kdns | `kubectl describe namespace` | Describe namespace resource in detail | -| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | -| | | **ConfigMap management** | -| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | -| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | -| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | -| kdelcm | `kubectl delete configmap` | Delete the configmap | -| | | **Secret management** | -| kgsec | `kubectl get secret` | Get secret for decoding | -| kdsec | `kubectl describe secret` | Describe secret resource in detail | -| kdelsec | `kubectl delete secret` | Delete the secret | -| | | **Deployment management** | -| kgd | `kubectl get deployment` | Get the deployment | -| kgdw | `kgd --watch` | After getting the deployment, watch for changes | -| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | -| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | -| kdd | `kubectl describe deployment` | Describe deployment resource in detail | -| kdeld | `kubectl delete deployment` | Delete the deployment | -| ksd | `kubectl scale deployment` | Scale a deployment | -| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | -| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | -| | | **Rollout management** | -| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | -| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | -| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | -| krh | `kubectl rollout history` | Check the revisions of this deployment | -| kru | `kubectl rollout undo` | Rollback to the previous revision | -| | | **Port forwarding** | -| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | -| | | **Tools for accessing all information** | -| kga | `kubectl get all` | List all resources in ps format | -| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | -| | | **Logs** | -| kl | `kubectl logs` | Print the logs for a container or resource | -| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | -| | | **File copy** | -| kcp | `kubectl cp` | Copy files and directories to and from containers | -| | | **Node management** | -| kgno | `kubectl get nodes` | List the nodes in ps output format | -| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | -| keno | `kubectl edit node` | Edit nodes resource from the default editor | -| kdno | `kubectl describe node` | Describe node resource in detail | -| kdelno | `kubectl delete node` | Delete the node | -| | | **Persistent Volume Claim management** | -| kgpvc | `kubectl get pvc` | List all PVCs | -| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | -| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | -| kdpvc | `kubectl describe pvc` | Describe all pvcs | -| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | -| | | **StatefulSets management** | -| kgss | `kubectl get statefulset` | List the statefulsets in ps format | -| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | -| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | -| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | -| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | -| kdelss | `kubectl delete statefulset` | Delete the statefulset | -| ksss | `kubectl scale statefulset` | Scale a statefulset | -| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment | -| | | **Service Accounts management** | -| kdsa | `kubectl describe sa` | Describe a service account in details | -| kdelsa | `kubectl delete sa` | Delete the service account | -| | | **DaemonSet management** | -| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | -| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | -| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | -| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | -| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | -| | | **CronJob management** | -| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | -| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | -| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | -| kdelcj | `kubectl delete cronjob` | Delete the CronJob | -| | | **Job management** | -| kgj | `kubectl get job` | List all Job in ps output format | -| kej | `kubectl edit job` | Edit a Job in details | -| kdj | `kubectl describe job` | Describe the Job | -| kdelj | `kubectl delete job` | Delete the Job | +| Alias | Command | Description | +| :------- | :------------------------------------------------------ | :----------------------------------------------------------------------------------------------- | +| k | `kubectl` | The kubectl command | +| kca | `kubectl --all-namespaces` | The kubectl command targeting all namespaces | +| kaf | `kubectl apply -f` | Apply a YML file | +| keti | `kubectl exec -ti` | Drop into an interactive terminal on a container | +| | | **Manage configuration quickly to switch contexts between local, dev and staging** | +| kcuc | `kubectl config use-context` | Set the current-context in a kubeconfig file | +| kcsc | `kubectl config set-context` | Set a context entry in kubeconfig | +| kcdc | `kubectl config delete-context` | Delete the specified context from the kubeconfig | +| kccc | `kubectl config current-context` | Display the current-context | +| kcgc | `kubectl config get-contexts` | List of contexts available | +| | | **General aliases** | +| kdel | `kubectl delete` | Delete resources by filenames, stdin, resources and names, or by resources and label selector | +| kdelf | `kubectl delete -f` | Delete a pod using the type and name specified in -f argument | +| kge | `kubectl get events --sort-by=".lastTimestamp"` | Get events (sorted by timestamp) | +| kgew | `kubectl get events --watch --sort-by=".lastTimestamp"` | Get events and watch as they occur (sorted by timestamp) | +| | | **Pod management** | +| kgp | `kubectl get pods` | List all pods in ps output format | +| kgpl | `kgp -l` | Get pods by label. Example: `kgpl "app=myapp" -n myns` | +| kgpn | `kgp -n` | Get pods by namespace. Example: `kgpn kube-system` | +| kgpsl | `kubectl get pods --show-labels` | List all pods in ps output format with labels | +| kgpw | `kgp --watch` | After listing/getting the requested object, watch for changes | +| kgpwide | `kgp -o wide` | Output in plain-text format with any additional information. For pods, the node name is included | +| kep | `kubectl edit pods` | Edit pods from the default editor | +| kdp | `kubectl describe pods` | Describe all pods | +| kdelp | `kubectl delete pods` | Delete all pods matching passed arguments | +| | | **Service management** | +| kgs | `kubectl get svc` | List all services in ps output format | +| kgsw | `kgs --watch` | After listing all services, watch for changes | +| kgswide | `kgs -o wide` | After listing all services, output in plain-text format with any additional information | +| kes | `kubectl edit svc` | Edit services(svc) from the default editor | +| kds | `kubectl describe svc` | Describe all services in detail | +| kdels | `kubectl delete svc` | Delete all services matching passed argument | +| | | **Ingress management** | +| kgi | `kubectl get ingress` | List ingress resources in ps output format | +| kei | `kubectl edit ingress` | Edit ingress resource from the default editor | +| kdi | `kubectl describe ingress` | Describe ingress resource in detail | +| kdeli | `kubectl delete ingress` | Delete ingress resources matching passed argument | +| | | **Namespace management** | +| kgns | `kubectl get namespaces` | List the current namespaces in a cluster | +| kcn | `kubectl config set-context --current --namespace` | Change current namespace | +| kens | `kubectl edit namespace` | Edit namespace resource from the default editor | +| kdns | `kubectl describe namespace` | Describe namespace resource in detail | +| kdelns | `kubectl delete namespace` | Delete the namespace. WARNING! This deletes everything in the namespace | +| | | **ConfigMap management** | +| kgcm | `kubectl get configmaps` | List the configmaps in ps output format | +| kecm | `kubectl edit configmap` | Edit configmap resource from the default editor | +| kdcm | `kubectl describe configmap` | Describe configmap resource in detail | +| kdelcm | `kubectl delete configmap` | Delete the configmap | +| | | **Secret management** | +| kgsec | `kubectl get secret` | Get secret for decoding | +| kdsec | `kubectl describe secret` | Describe secret resource in detail | +| kdelsec | `kubectl delete secret` | Delete the secret | +| | | **Deployment management** | +| kgd | `kubectl get deployment` | Get the deployment | +| kgdw | `kgd --watch` | After getting the deployment, watch for changes | +| kgdwide | `kgd -o wide` | After getting the deployment, output in plain-text format with any additional information | +| ked | `kubectl edit deployment` | Edit deployment resource from the default editor | +| kdd | `kubectl describe deployment` | Describe deployment resource in detail | +| kdeld | `kubectl delete deployment` | Delete the deployment | +| ksd | `kubectl scale deployment` | Scale a deployment | +| krsd | `kubectl rollout status deployment` | Check the rollout status of a deployment | +| kres | `kubectl set env $@ REFRESHED_AT=...` | Recreate all pods in deployment with zero-downtime | +| | | **Rollout management** | +| kgrs | `kubectl get replicaset` | List all ReplicaSets `rs` created by the deployment | +| kdrs | `kubectl describe replicaset` | Describe ReplicaSet in detail | +| kers | `kubectl edit replicaset` | Edit ReplicaSet from the default editor | +| krh | `kubectl rollout history` | Check the revisions of this deployment | +| kru | `kubectl rollout undo` | Rollback to the previous revision | +| | | **Port forwarding** | +| kpf | `kubectl port-forward` | Forward one or more local ports to a pod | +| | | **Tools for accessing all information** | +| kga | `kubectl get all` | List all resources in ps format | +| kgaa | `kubectl get all --all-namespaces` | List the requested object(s) across all namespaces | +| | | **Logs** | +| kl | `kubectl logs` | Print the logs for a container or resource | +| klf | `kubectl logs -f` | Stream the logs for a container or resource (follow) | +| | | **File copy** | +| kcp | `kubectl cp` | Copy files and directories to and from containers | +| | | **Node management** | +| kgno | `kubectl get nodes` | List the nodes in ps output format | +| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | +| keno | `kubectl edit node` | Edit nodes resource from the default editor | +| kdno | `kubectl describe node` | Describe node resource in detail | +| kdelno | `kubectl delete node` | Delete the node | +| | | **Persistent Volume Claim management** | +| kgpvc | `kubectl get pvc` | List all PVCs | +| kgpvcw | `kgpvc --watch` | After listing/getting the requested object, watch for changes | +| kepvc | `kubectl edit pvc` | Edit pvcs from the default editor | +| kdpvc | `kubectl describe pvc` | Describe all pvcs | +| kdelpvc | `kubectl delete pvc` | Delete all pvcs matching passed arguments | +| | | **StatefulSets management** | +| kgss | `kubectl get statefulset` | List the statefulsets in ps format | +| kgssw | `kgss --watch` | After getting the list of statefulsets, watch for changes | +| kgsswide | `kgss -o wide` | After getting the statefulsets, output in plain-text format with any additional information | +| kess | `kubectl edit statefulset` | Edit statefulset resource from the default editor | +| kdss | `kubectl describe statefulset` | Describe statefulset resource in detail | +| kdelss | `kubectl delete statefulset` | Delete the statefulset | +| ksss | `kubectl scale statefulset` | Scale a statefulset | +| krsss | `kubectl rollout status statefulset` | Check the rollout status of a deployment | +| | | **Service Accounts management** | +| kdsa | `kubectl describe sa` | Describe a service account in details | +| kdelsa | `kubectl delete sa` | Delete the service account | +| | | **DaemonSet management** | +| kgds | `kubectl get daemonset` | List all DaemonSets in ps output format | +| kgdsw | `kgds --watch` | After listing all DaemonSets, watch for changes | +| keds | `kubectl edit daemonset` | Edit DaemonSets from the default editor | +| kdds | `kubectl describe daemonset` | Describe all DaemonSets in detail | +| kdelds | `kubectl delete daemonset` | Delete all DaemonSets matching passed argument | +| | | **CronJob management** | +| kgcj | `kubectl get cronjob` | List all CronJobs in ps output format | +| kecj | `kubectl edit cronjob` | Edit CronJob from the default editor | +| kdcj | `kubectl describe cronjob` | Describe a CronJob in details | +| kdelcj | `kubectl delete cronjob` | Delete the CronJob | +| | | **Job management** | +| kgj | `kubectl get job` | List all Job in ps output format | +| kej | `kubectl edit job` | Edit a Job in details | +| kdj | `kubectl describe job` | Describe the Job | +| kdelj | `kubectl delete job` | Delete the Job | ## Wrappers diff --git a/plugins/kubectl/kubectl.plugin.zsh b/plugins/kubectl/kubectl.plugin.zsh index 33699bdf9..4a72c02af 100644 --- a/plugins/kubectl/kubectl.plugin.zsh +++ b/plugins/kubectl/kubectl.plugin.zsh @@ -36,6 +36,8 @@ alias kcgc='kubectl config get-contexts' # General aliases alias kdel='kubectl delete' alias kdelf='kubectl delete -f' +alias kge='kubectl get events --sort-by=".lastTimestamp"' +alias kgew='kubectl get events --sort-by=".lastTimestamp" --watch' # Pod management. alias kgp='kubectl get pods' From 95ef2516697aa764d1d4bb93ad3490584cc118ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yunus=20Emre=20Akbal=C4=B1k?= <58446763+YunusAkbalik@users.noreply.github.com> Date: Thu, 29 May 2025 13:49:56 +0300 Subject: [PATCH 43/82] feat(dotnet): add `restore` alias (#13146) --- plugins/dotnet/README.md | 1 + plugins/dotnet/dotnet.plugin.zsh | 1 + 2 files changed, 2 insertions(+) diff --git a/plugins/dotnet/README.md b/plugins/dotnet/README.md index a15e80577..217c46751 100644 --- a/plugins/dotnet/README.md +++ b/plugins/dotnet/README.md @@ -23,3 +23,4 @@ plugins=(... dotnet) | dp | dotnet pack | Create a NuGet package. | | dng | dotnet nuget | Provides additional NuGet commands. | | db | dotnet build | Build a .NET project | +| dres | dotnet restore | Restore dependencies and project-specific tools for a project. | \ No newline at end of file diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index ed7c55024..adc1ec678 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -24,3 +24,4 @@ alias da='dotnet add' alias dp='dotnet pack' alias dng='dotnet nuget' alias db='dotnet build' +alias dres='dotnet restore' From ac5295678f3325de1a69f9e2a603d69573112d05 Mon Sep 17 00:00:00 2001 From: AYO_YO <64309671+AYO-YO@users.noreply.github.com> Date: Sun, 8 Jun 2025 16:23:48 +0800 Subject: [PATCH 44/82] feat(agnoster): add conda support (#13160) Co-authored-by: Carlo Sala --- themes/agnoster.zsh-theme | 3 +++ 1 file changed, 3 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index 21c9cf7d5..c99b604b5 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -314,6 +314,9 @@ prompt_dir() { # Virtualenv: current working virtualenv prompt_virtualenv() { + if [ -n "$CONDA_DEFAULT_ENV" ]; then + prompt_segment magenta $CURRENT_FG "🐍 $CONDA_DEFAULT_ENV" + fi if [[ -n "$VIRTUAL_ENV" && -n "$VIRTUAL_ENV_DISABLE_PROMPT" ]]; then prompt_segment "$AGNOSTER_VENV_BG" "$AGNOSTER_VENV_FG" "(${VIRTUAL_ENV:t:gs/%/%%})" fi From 788eaa5930eeafceb0cc43f338b0bacf7a2e36a8 Mon Sep 17 00:00:00 2001 From: James Langley Date: Sun, 8 Jun 2025 09:25:23 +0100 Subject: [PATCH 45/82] fix(functions): escape especial chars in WSL (#13158) --- lib/functions.zsh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/functions.zsh b/lib/functions.zsh index b68c35c13..330b0e3e9 100644 --- a/lib/functions.zsh +++ b/lib/functions.zsh @@ -23,6 +23,9 @@ function open_command() { linux*) [[ "$(uname -r)" != *icrosoft* ]] && open_cmd='nohup xdg-open' || { open_cmd='cmd.exe /c start ""' [[ -e "$1" ]] && { 1="$(wslpath -w "${1:a}")" || return 1 } + [[ "$1" = (http|https)://* ]] && { + 1="$(echo "$1" | sed -E 's/([&|()<>^])/^\1/g')" || return 1 + } } ;; msys*) open_cmd='start ""' ;; *) echo "Platform $OSTYPE not supported" From 3ff8c7ef678a990a88ca988c3a4f007296af4934 Mon Sep 17 00:00:00 2001 From: Rob Lugton Date: Tue, 10 Jun 2025 04:40:46 +1000 Subject: [PATCH 46/82] feat(agnoster): add terraform to prompt (#7892) --- themes/agnoster.zsh-theme | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme index c99b604b5..63452378d 100644 --- a/themes/agnoster.zsh-theme +++ b/themes/agnoster.zsh-theme @@ -353,12 +353,19 @@ prompt_aws() { esac } +prompt_terraform() { + local terraform_info=$(tf_prompt_info) + [[ -z "$terraform_info" ]] && return + prompt_segment magenta yellow "TF: $terraform_info" +} + ## Main prompt build_prompt() { RETVAL=$? prompt_status prompt_virtualenv prompt_aws + prompt_terraform prompt_context prompt_dir prompt_git From 042605ee6b2afeb21e380d05b22d5072f0eeff44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 10 Jun 2025 16:15:59 +0200 Subject: [PATCH 47/82] chore(deps): bump requests in /.github/workflows/dependencies (#13164) Bumps [requests](https://github.com/psf/requests) from 2.32.3 to 2.32.4. - [Release notes](https://github.com/psf/requests/releases) - [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md) - [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.32.4) --- updated-dependencies: - dependency-name: requests dependency-version: 2.32.4 dependency-type: direct:production ... 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 e73c1b5ca..5dae1f64b 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -2,6 +2,6 @@ certifi==2025.4.26 charset-normalizer==3.4.2 idna==3.10 PyYAML==6.0.2 -requests==2.32.3 +requests==2.32.4 semver==3.0.4 urllib3==2.4.0 From 2fbdfa93f942611c56bb02657a39f577bd7f0ef0 Mon Sep 17 00:00:00 2001 From: Sergii Tkachenko Date: Mon, 16 Jun 2025 07:54:12 -0700 Subject: [PATCH 48/82] fix(init): ensure hostname is always valid for macOS (#13171) --- oh-my-zsh.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index 2e885219c..3e547d358 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -99,8 +99,8 @@ done # Figure out the SHORT hostname if [[ "$OSTYPE" = darwin* ]]; then - # macOS's $HOST changes with dhcp, etc. Use ComputerName if possible. - SHORT_HOST=$(scutil --get ComputerName 2>/dev/null) || SHORT_HOST="${HOST/.*/}" + # macOS's $HOST changes with dhcp, etc. Use LocalHostName if possible. + SHORT_HOST=$(scutil --get LocalHostName 2>/dev/null) || SHORT_HOST="${HOST/.*/}" else SHORT_HOST="${HOST/.*/}" fi From 7ee92de190b3710b55aa04e10eb54e907587e61c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Jun 2025 10:02:32 +0200 Subject: [PATCH 49/82] chore(deps): bump urllib3 in /.github/workflows/dependencies (#13176) 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 5dae1f64b..d2c8bdcc9 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.4 semver==3.0.4 -urllib3==2.4.0 +urllib3==2.5.0 From f8022980a3423f25e3d5e1b6a60d2372a2ba006b Mon Sep 17 00:00:00 2001 From: Amr Elsayyad <20210190+AmrElsayyad@users.noreply.github.com> Date: Thu, 19 Jun 2025 11:05:40 +0300 Subject: [PATCH 50/82] feat(ubuntu): add `apt-fast` support (#13175) --- plugins/ubuntu/README.md | 17 +++++++++-------- plugins/ubuntu/ubuntu.plugin.zsh | 15 +++++++++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/plugins/ubuntu/README.md b/plugins/ubuntu/README.md index 20f5c65ee..4b09ba02b 100644 --- a/plugins/ubuntu/README.md +++ b/plugins/ubuntu/README.md @@ -10,10 +10,11 @@ plugins=(... ubuntu) ## Aliases -Commands that use `$APT` will use `apt` if installed or defer to `apt-get` otherwise. +Commands that use `$APT` will use `apt-fast` if installed, or `apt` if installed, or defer to `apt-get` +otherwise. | Alias | Command | Description | -|---------|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------| +| ------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------- | | age | `sudo $APT` | Run apt-get with sudo | | acs | `apt-cache search` | Search the apt-cache with the specified criteria | | acsp | `apt-cache showpkg` | Shows information about the listed packages | @@ -26,7 +27,7 @@ Commands that use `$APT` will use `apt` if installed or defer to `apt-get` other | agd | `sudo $APT dselect-upgrade` | Follows dselect choices for package installation | | agi | `sudo $APT install ` | Install the specified package | | agli | `apt list --installed` | List the installed packages | -| aglu | `sudo apt-get -u upgrade --assume-no` | Run an apt-get upgrade assuming no to all prompts | +| aglu | `apt list --upgradable` | List available updates only | | agp | `sudo $APT purge ` | Remove a package including any configuration files | | agr | `sudo $APT remove ` | Remove a package | | ags | `$APT source ` | Fetch the source for the specified package | @@ -36,21 +37,20 @@ Commands that use `$APT` will use `apt` if installed or defer to `apt-get` other | agar | `sudo $APT autoremove` | Remove automatically installed packages no longer needed | | aguu | `sudo $APT update && sudo $APT upgrade` | Update packages list and upgrade available packages | | allpkgs | `dpkg --get-selections \| grep -v deinstall` | Print all installed packages | -| kclean | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` |Remove ALL kernel images and headers EXCEPT the one in use | +| kclean | `sudo aptitude remove -P ?and(~i~nlinux-(ima\|hea) ?not(~n$(uname -r)))` | Remove ALL kernel images and headers EXCEPT the one in use | | mydeb | `time dpkg-buildpackage -rfakeroot -us -uc` | Create a basic .deb package | | ppap | `sudo ppa-purge ` | Remove the specified PPA | - ## Functions -| Function | Usage |Description | -|-------------------|---------------------------------------|--------------------------------------------------------------------------| +| Function | Usage | Description | +| ----------------- | ------------------------------------- | ------------------------------------------------------------------------ | | aar | `aar ppa:xxxxxx/xxxxxx [packagename]` | apt-add-repository with automatic install/upgrade of the desired package | | apt-history | `apt-history ` | Prints the Apt history of the specified action | | apt-list-packages | `apt-list-packages` | List packages by size | | kerndeb | `kerndeb` | Kernel-package building shortcut | -## Authors: +## Authors - [@AlexBio](https://github.com/AlexBio) - [@dbb](https://github.com/dbb) @@ -59,3 +59,4 @@ Commands that use `$APT` will use `apt` if installed or defer to `apt-get` other - [Nicolas Jonas](https://nextgenthemes.com) - [@loctauxphilippe](https://github.com/loctauxphilippe) - [@HaraldNordgren](https://github.com/HaraldNordgren) +- [@AmrElsayyad](https://github.com/AmrElsayyad) diff --git a/plugins/ubuntu/ubuntu.plugin.zsh b/plugins/ubuntu/ubuntu.plugin.zsh index 7b765a406..66e2d52cb 100644 --- a/plugins/ubuntu/ubuntu.plugin.zsh +++ b/plugins/ubuntu/ubuntu.plugin.zsh @@ -1,11 +1,22 @@ -(( $+commands[apt] )) && APT=apt || APT=apt-get +# Detect available package manager (prefer apt-fast > apt > apt-get) +if (( $+commands[apt-fast] )); then + APT=apt-fast +elif (( $+commands[apt] )); then + APT=apt +else + APT=apt-get +fi alias acs='apt-cache search' alias afs='apt-file search --regexp' # These are apt/apt-get only -alias ags="$APT source" +if (( $+commands[apt] )); then + alias ags="apt source" +else + alias ags="apt-get source" +fi alias acp='apt-cache policy' From 01433503c2a474c049fa56d792ebfd9274e683cc Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Wed, 25 Jun 2025 21:33:17 +0200 Subject: [PATCH 51/82] fix(rbw): reset clipboard in `rbwpw` only in the last invocation (#13185) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous behavior would reset the clipboard after 20 seconds always, even if the `rbwpw` function was called again in between. This commit fixes that behavior. Co-authored-by: Marc Cornellà --- plugins/rbw/rbw.plugin.zsh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plugins/rbw/rbw.plugin.zsh b/plugins/rbw/rbw.plugin.zsh index b6cecf8b4..0b55e6e5f 100644 --- a/plugins/rbw/rbw.plugin.zsh +++ b/plugins/rbw/rbw.plugin.zsh @@ -29,9 +29,24 @@ function rbwpw { echo "$service not found" return 1 fi + + # Generate a random identifier for this call to rbwpw + # so we can check if the clipboard content has changed + local _random="$RANDOM" _cache="$ZSH_CACHE_DIR/.rbwpw" + echo -n "$_random" > "$_cache" + + # Use clipcopy to copy the password to the clipboard echo -n $pw | clipcopy echo "password for $service copied!" - {sleep 20 && clipcopy /dev/null} &| + + # Clear the clipboard after 20 seconds, but only if the clipboard hasn't + # changed (if rbwpw hasn't been called again) + { + sleep 20 \ + && [[ "$(<"$_cache")" == "$_random" ]] \ + && clipcopy /dev/null \ + && command rm -f "$_cache" &>/dev/null + } &| } function _rbwpw { From f9d3e0ff568820be25a80ed80b7a4776f3fb009a Mon Sep 17 00:00:00 2001 From: "ohmyzsh[bot]" <54982679+ohmyzsh[bot]@users.noreply.github.com> Date: Sun, 29 Jun 2025 17:09:07 +0200 Subject: [PATCH 52/82] feat(wd): update to v0.10.1 (#13192) Co-authored-by: ohmyzsh[bot] <54982679+ohmyzsh[bot]@users.noreply.github.com> --- .github/dependencies.yml | 2 +- plugins/wd/README.md | 9 +++------ plugins/wd/wd.sh | 25 ++++++++++++++++--------- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/dependencies.yml b/.github/dependencies.yml index 23168b91a..b67a4c7ed 100644 --- a/.github/dependencies.yml +++ b/.github/dependencies.yml @@ -30,7 +30,7 @@ dependencies: plugins/wd: repo: mfaerevaag/wd branch: master - version: tag:v0.10.0 + version: tag:v0.10.1 precopy: | set -e rm -r test diff --git a/plugins/wd/README.md b/plugins/wd/README.md index b345d65f5..1240afe57 100644 --- a/plugins/wd/README.md +++ b/plugins/wd/README.md @@ -65,12 +65,9 @@ Add the following to your `home.nix` then run `home-manager switch`: programs.zsh.plugins = [ { name = "wd"; - src = pkgs.fetchFromGitHub { - owner = "mfaerevaag"; - repo = "wd"; - rev = "v0.5.2"; - sha256 = "sha256-4yJ1qhqhNULbQmt6Z9G22gURfDLe30uV1ascbzqgdhg="; - }; + src = pkgs.zsh-wd; + file = "share/wd/wd.plugin.zsh"; + completions = [ "share/zsh/site-functions" ]; } ]; ``` diff --git a/plugins/wd/wd.sh b/plugins/wd/wd.sh index f7a22ff7d..56c029252 100755 --- a/plugins/wd/wd.sh +++ b/plugins/wd/wd.sh @@ -8,7 +8,7 @@ # @github.com/mfaerevaag/wd # version -readonly WD_VERSION=0.10.0 +readonly WD_VERSION=0.10.1 # colors readonly WD_BLUE="\033[96m" @@ -174,6 +174,11 @@ wd_add() point=$(basename "$PWD") fi + if [ ! -w "$wd_config_file" ]; then + wd_exit_fail "\'$wd_config_file\' is not writeable." + return + fi + if [[ $point =~ "^[\.]+$" ]] then wd_exit_fail "Warp point cannot be just dots" @@ -239,6 +244,11 @@ wd_remove() point_list=$(basename "$PWD") fi + if [ ! -w "$wd_config_file" ]; then + wd_exit_fail "\'$wd_config_file\' is not writeable." + return + fi + for point_name in $point_list ; do if [[ ${points[$point_name]} != "" ]] then @@ -440,6 +450,11 @@ wd_clean() { local count=0 local wd_tmp="" + if [ ! -w "$wd_config_file" ]; then + wd_exit_fail "\'$wd_config_file\' is not writeable." + return + fi + while read -r line do if [[ $line != "" ]] @@ -543,14 +558,6 @@ args=$(getopt -o a:r:c:lhs -l add:,rm:,clean,list,ls:,open:,path:,help,show -- $ if [[ ($? -ne 0 || $#* -eq 0) && -z $wd_print_version ]] then wd_print_usage - -# check if config file is writeable -elif [ ! -w "$wd_config_file" ] -then - # do nothing - # can't run `exit`, as this would exit the executing shell - wd_exit_fail "\'$wd_config_file\' is not writeable." - else # parse rest of options local wd_o From cb72d7dcbf08b435c7f8a6470802b207b2aa02c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kalle=20Ahlstr=C3=B6m?= <71292737+kahlstrm@users.noreply.github.com> Date: Sun, 29 Jun 2025 18:11:47 +0300 Subject: [PATCH 53/82] fix(af-magic): fix venv prompt counting parenthesis (#13190) --- themes/af-magic.zsh-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/af-magic.zsh-theme b/themes/af-magic.zsh-theme index 668c4e5de..f47d37340 100644 --- a/themes/af-magic.zsh-theme +++ b/themes/af-magic.zsh-theme @@ -14,7 +14,7 @@ function afmagic_dashes { if [[ -n "$python_env" && "$PS1" = *\(${python_env}\)* ]]; then echo $(( COLUMNS - ${#python_env} - 3 )) elif [[ -n "$VIRTUAL_ENV_PROMPT" && "$PS1" = *${VIRTUAL_ENV_PROMPT}* ]]; then - echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} )) + echo $(( COLUMNS - ${#VIRTUAL_ENV_PROMPT} - 3 )) else echo $COLUMNS fi From 3e7ef0182f59c7990a52cf6ec2981adb56d5b368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 1 Jul 2025 17:59:18 +0200 Subject: [PATCH 54/82] chore: document Incident Response Plan (#13195) --- .github/INCIDENT_RESPONSE_PLAN.md | 87 +++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 .github/INCIDENT_RESPONSE_PLAN.md diff --git a/.github/INCIDENT_RESPONSE_PLAN.md b/.github/INCIDENT_RESPONSE_PLAN.md new file mode 100644 index 000000000..3f0b493c6 --- /dev/null +++ b/.github/INCIDENT_RESPONSE_PLAN.md @@ -0,0 +1,87 @@ +# Incident Response Plan + +## Reporting a Vulnerability + +Please see [the latest guidelines](https://github.com/ohmyzsh/ohmyzsh/blob/master/SECURITY.md) for instructions. + +## Phases + +### Triage + +1. Is this a valid security vulnerability? + + - [ ] It affects our CI/CD or any of our repositories. + - [ ] For ohmyzsh/ohmyzsh, it affects the latest commit. + - [ ] For others, it affects the latest commit on the default branch. + - [ ] It affects a third-party dependency: + - [ ] Zsh or git + - [ ] For a plugin, the vulnerability is a result of our usage of the dependency. + +2. What's the scope of the vulnerability? + + - [ ] Our codebase. + - [ ] A direct third-party dependency (Zsh, git, other plugins). + - [ ] An indirect third-party dependency. + - [ ] Out of scope, a third-party dependency that is the responsibility of the user. + - [ ] Out of scope, any other case (edit this plan and add the details). + +3. Is the vulnerability actionable? + + - [ ] Yes, we can submit a fix. + - [ ] Yes, we can disable a feature. + - [ ] Yes, we can mitigate the risk. + - [ ] Yes, we can remove a vulnerable dependency. + - [ ] Yes, we can apply a workaround. + - [ ] Yes, we can apply a patch to a vulnerable dependency ([example for CVE-2021-45444](https://github.com/ohmyzsh/ohmyzsh/blob/cb72d7dcbf08b435c7f8a6470802b207b2aa02c3/lib/vcs_info.zsh)). + - [ ] No, the vulnerability is not actionable. + +4. What's the impact of the vulnerability? + + Assess using the *CIA* triad: + + - **Confidentiality**: example: report or sharing of secrets. + - **Integrity**: affects the integrity of the system (deletion, corruption or encryption of data, OS file corruption, etc.). + - **Availability**: denial of login, deletion of required files to boot / login, etc. + +5. What's the exploitability of the vulnerability? + + Consider how easy it is to exploit, and if it affects all users or requires specific configurations. + +6. What's the severity of the vulnerability? + + You can use the [CVSS v3.1](https://www.first.org/cvss/specification-document) to assess the severity of the vulnerability. + +7. When was the vulnerability introduced? + + - Find the responsible code path. + - Find the commit or Pull Request that introduced the vulnerability. + +8. Who are our security contacts? + + Assess upstream or downstream contacts, and their desired channels of security. + + > TODO: add a list of contacts. + +### Mitigation + +- **Primary focus:** removing possibility of exploitation fast. +- **Secondary focus:** addressing the root cause. + +> [!IMPORTANT] +> Make sure to test that the mitigation works as expected, and does not introduce new vulnerabilities. +> When deploying a patch, make sure not to disclose the vulnerability in the commit message or PR description. + +> TODO: introduce a fast-track update process for security patches. + +### Disclosure + +Primary goal: inform our users about the vulnerability, and whether they are affected or not affected based on information they should be able to check themselves in a straightforward way. + +> TODO: add a vulnerability disclosure template. + +### Learn + +- Document the vulnerability, steps performed, and lessons learned. +- Document the timeline of events. +- Document and address improvements on the Security Incident Response Plan. +- Depending on the severity of the vulnerability, consider disclosing the root cause or not based on likely impact on users and estimated potential victims still affected. From df200c943a1dcfa040f334b8006e495af39205fd Mon Sep 17 00:00:00 2001 From: Zachary Craig Date: Fri, 18 Jul 2025 06:44:05 -0400 Subject: [PATCH 55/82] feat(keychain): support >2.9 (#13189) Co-authored-by: Carlo Sala --- plugins/keychain/keychain.plugin.zsh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index f122f7982..8caf671f5 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -19,8 +19,15 @@ function { # load additional options zstyle -a :omz:plugins:keychain options options - # start keychain... - keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST + # Check keychain version to decide whether to use --agents + local version_string=$(keychain --version 2>&1 | head -n 2 | tail -n 1 | cut -d ' ' -f 4) + # start keychain, only use --agents for versions below 2.9.0 + autoload -Uz is-at-least + if is-at-least 2.9 "$version_string"; then + keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST + else + keychain ${^options:-} ${^identities} --host $SHORT_HOST + fi # Get the filenames to store/lookup the environment from _keychain_env_sh="$HOME/.keychain/$SHORT_HOST-sh" From dc3bbcda2689b26cfb16e714225e263fa74e3f70 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Fri, 18 Jul 2025 13:53:14 +0300 Subject: [PATCH 56/82] feat(web-search): add RubyGems.org (#13210) --- plugins/web-search/README.md | 1 + plugins/web-search/web-search.plugin.zsh | 2 ++ 2 files changed, 3 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index d0b03dff2..ed484f237 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -47,6 +47,7 @@ Available search contexts are: | `youtube` | `https://www.youtube.com/results?search_query=` | | `deepl` | `https://www.deepl.com/translator#auto/auto/` | | `dockerhub` | `https://hub.docker.com/search?q=` | +| `gems` | `https://rubygems.org/search?query=` | | `npmpkg` | `https://www.npmjs.com/search?q=` | | `packagist` | `https://packagist.org/?query=` | | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index ff77faed7..4eb42be57 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -28,6 +28,7 @@ function web_search() { youtube "https://www.youtube.com/results?search_query=" deepl "https://www.deepl.com/translator#auto/auto/" dockerhub "https://hub.docker.com/search?q=" + gems "https://rubygems.org/search?query=" npmpkg "https://www.npmjs.com/search?q=" packagist "https://packagist.org/?query=" gopkg "https://pkg.go.dev/search?m=package&q=" @@ -83,6 +84,7 @@ alias ask='web_search ask' alias youtube='web_search youtube' alias deepl='web_search deepl' alias dockerhub='web_search dockerhub' +alias gems='web_search gems' alias npmpkg='web_search npmpkg' alias packagist='web_search packagist' alias gopkg='web_search gopkg' From 8425e9774ea4be998a51c8c73c7f6e33000f9176 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 21 Jul 2025 10:04:10 +0200 Subject: [PATCH 57/82] fix(keychain): reversed logic Closes #13106 --- plugins/keychain/keychain.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/keychain/keychain.plugin.zsh b/plugins/keychain/keychain.plugin.zsh index 8caf671f5..ce5351bce 100644 --- a/plugins/keychain/keychain.plugin.zsh +++ b/plugins/keychain/keychain.plugin.zsh @@ -24,9 +24,9 @@ function { # start keychain, only use --agents for versions below 2.9.0 autoload -Uz is-at-least if is-at-least 2.9 "$version_string"; then - keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST - else keychain ${^options:-} ${^identities} --host $SHORT_HOST + else + keychain ${^options:-} --agents ${agents:-gpg} ${^identities} --host $SHORT_HOST fi # Get the filenames to store/lookup the environment from From 2ac69955e84d5ab2407e848275dfc2768b3b1531 Mon Sep 17 00:00:00 2001 From: Kevin De Keyser Date: Mon, 21 Jul 2025 17:11:35 +0800 Subject: [PATCH 58/82] fix(termsupport): ensure non-error return code (#13217) --- lib/termsupport.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/termsupport.zsh b/lib/termsupport.zsh index 994c9c322..852a543c5 100644 --- a/lib/termsupport.zsh +++ b/lib/termsupport.zsh @@ -53,7 +53,7 @@ function omz_termsupport_precmd { # Runs before executing the command function omz_termsupport_preexec { - [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return + [[ "${DISABLE_AUTO_TITLE:-}" != true ]] || return 0 emulate -L zsh setopt extended_glob From ff97957f1ccb33b1c1c27e47e2e24789ce2ae33f Mon Sep 17 00:00:00 2001 From: Bacluc Date: Mon, 21 Jul 2025 18:37:09 +0200 Subject: [PATCH 59/82] feat(tmux): avoid autostart inside `zed` editor (#13220) --- plugins/tmux/tmux.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/tmux/tmux.plugin.zsh b/plugins/tmux/tmux.plugin.zsh index d2729ec09..4c184c2d0 100644 --- a/plugins/tmux/tmux.plugin.zsh +++ b/plugins/tmux/tmux.plugin.zsh @@ -188,7 +188,7 @@ function _tmux_directory_session() { alias tds=_tmux_directory_session # Autostart if not already in tmux and enabled. -if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" ]]; then +if [[ -z "$TMUX" && "$ZSH_TMUX_AUTOSTART" == "true" && -z "$INSIDE_EMACS" && -z "$EMACS" && -z "$VIM" && -z "$INTELLIJ_ENVIRONMENT_READER" && -z "$ZED_TERM" ]]; then # Actually don't autostart if we already did and multiple autostarts are disabled. if [[ "$ZSH_TMUX_AUTOSTART_ONCE" == "false" || "$ZSH_TMUX_AUTOSTARTED" != "true" ]]; then export ZSH_TMUX_AUTOSTARTED=true From e3e468d1388d262b0018350a1248a176bfb31660 Mon Sep 17 00:00:00 2001 From: jishudashen Date: Tue, 22 Jul 2025 00:39:25 +0800 Subject: [PATCH 60/82] chore: fix typos (#13219) --- lib/completion.zsh | 2 +- plugins/dnf/_dnf5 | 2 +- plugins/dotnet/dotnet.plugin.zsh | 2 +- plugins/git/git.plugin.zsh | 2 +- plugins/systemadmin/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/completion.zsh b/lib/completion.zsh index 5a233a322..3823c2544 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -40,7 +40,7 @@ fi # disable named-directories autocompletion zstyle ':completion:*:cd:*' tag-order local-directories directory-stack path-directories -# Use caching so that commands like apt and dpkg complete are useable +# Use caching so that commands like apt and dpkg complete are usable zstyle ':completion:*' use-cache yes zstyle ':completion:*' cache-path $ZSH_CACHE_DIR diff --git a/plugins/dnf/_dnf5 b/plugins/dnf/_dnf5 index 9cbf451a8..3422fae32 100644 --- a/plugins/dnf/_dnf5 +++ b/plugins/dnf/_dnf5 @@ -272,7 +272,7 @@ _dnf5-repoquery() { for v in enhance obsolete provide recommend require suggest supplement; do opts+=( "--what${v}s=[limit to packages that $v specified capabilities]:list of capability: ") done - # mutually exclusive formating options + # mutually exclusive formatting options opts+=( + '(format)' '--conflicts[display capabilities that the package conflicts with]' diff --git a/plugins/dotnet/dotnet.plugin.zsh b/plugins/dotnet/dotnet.plugin.zsh index adc1ec678..2b7782474 100644 --- a/plugins/dotnet/dotnet.plugin.zsh +++ b/plugins/dotnet/dotnet.plugin.zsh @@ -10,7 +10,7 @@ _dotnet_completion() { compdef _dotnet_completion dotnet -# Aliases bellow are here for backwards compatibility +# Aliases below are here for backwards compatibility # added by Shaun Tabone (https://github.com/xontab) alias dn='dotnet new' diff --git a/plugins/git/git.plugin.zsh b/plugins/git/git.plugin.zsh index 1d043da35..335eaa8d0 100644 --- a/plugins/git/git.plugin.zsh +++ b/plugins/git/git.plugin.zsh @@ -86,7 +86,7 @@ function work_in_progress() { # Aliases # (sorted alphabetically by command) # (order should follow README) -# (in some cases force the alisas order to match README, like for example gke and gk) +# (in some cases force the alias order to match README, like for example gke and gk) # alias grt='cd "$(git rev-parse --show-toplevel || echo .)"' diff --git a/plugins/systemadmin/README.md b/plugins/systemadmin/README.md index 7ff21a635..7847e15e9 100644 --- a/plugins/systemadmin/README.md +++ b/plugins/systemadmin/README.md @@ -49,4 +49,4 @@ plugins=(... systemadmin) | geteip | Gather information regarding an external IP address using [icanhazip.com](https://icanhazip.com) | | getip | Determine the local IP Address with `ip addr` or `ifconfig` | | clrz | Clear zombie processes | -| conssec | Show number of concurrent connections per second based on ngnix/access.log file or another log file if specified | +| conssec | Show number of concurrent connections per second based on nginx/access.log file or another log file if specified | From 537807c863a90c51a4ec6fbb6b818c3668472425 Mon Sep 17 00:00:00 2001 From: Roeniss Moon Date: Tue, 22 Jul 2025 01:58:09 +0900 Subject: [PATCH 61/82] feat(alias-finder): use ripgrep if possible (#13043) Co-authored-by: Carlo Sala --- plugins/alias-finder/README.md | 8 +++++--- plugins/alias-finder/alias-finder.plugin.zsh | 6 +++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/plugins/alias-finder/README.md b/plugins/alias-finder/README.md index a9bbd0838..b24f8d4ac 100644 --- a/plugins/alias-finder/README.md +++ b/plugins/alias-finder/README.md @@ -11,6 +11,8 @@ plugins=(... alias-finder) To enable it for every single command, set zstyle in your `~/.zshrc`. +If the user has installed `rg`([ripgrep](https://github.com/BurntSushi/ripgrep)), it will be used because it's faster. Otherwise, it will use the `grep` command. + ```zsh # ~/.zshrc @@ -28,7 +30,7 @@ When you execute a command alias finder will look at your defined aliases and su Running the un-aliased `git status` command: ```sh -╭─tim@fox ~/repo/gitopolis ‹main› +╭─tim@fox ~/repo/gitopolis ‹main› ╰─$ git status gst='git status' # <=== shorter suggestion from alias-finder @@ -40,7 +42,7 @@ nothing to commit, working tree clean Running a shorter `git st` alias from `.gitconfig` that it suggested : ```sh -╭─tim@fox ~/repo/gitopolis ‹main› +╭─tim@fox ~/repo/gitopolis ‹main› ╰─$ git st gs='git st' # <=== shorter suggestion from alias-finder ## main...origin/main @@ -48,7 +50,7 @@ gs='git st' # <=== shorter suggestion from alias-finder Running the shortest `gs` shell alias that it found: ```sh -╭─tim@fox ~/repo/gitopolis ‹main› +╭─tim@fox ~/repo/gitopolis ‹main› ╰─$ gs # <=== no suggestions alias-finder because this is the shortest ## main...origin/main diff --git a/plugins/alias-finder/alias-finder.plugin.zsh b/plugins/alias-finder/alias-finder.plugin.zsh index 2351a439e..6f24c7089 100644 --- a/plugins/alias-finder/alias-finder.plugin.zsh +++ b/plugins/alias-finder/alias-finder.plugin.zsh @@ -43,7 +43,11 @@ alias-finder() { filter="^'?.{1,$((cmdLen - 1))}'?=" # some aliases is surrounded by single quotes fi - alias | grep -E "$filter" | grep -E "=$finder" + if (( $+commands[rg] )); then + alias | rg "$filter" | rg "=$finder" + else + alias | grep -E "$filter" | grep -E "=$finder" + fi if [[ $exact == true ]]; then break # because exact case is only one From 788b5776c03996d6c88dce786f9e0879a0c3aa6e Mon Sep 17 00:00:00 2001 From: Wagner Moreira <47096330+wagnermor@users.noreply.github.com> Date: Tue, 22 Jul 2025 14:29:47 -0300 Subject: [PATCH 62/82] feat(web-search): add search with `claude.ai` and `grok.com` (#13222) --- plugins/web-search/README.md | 2 ++ plugins/web-search/web-search.plugin.zsh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index ed484f237..26017a533 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -52,6 +52,8 @@ Available search contexts are: | `packagist` | `https://packagist.org/?query=` | | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | | `chatgpt` | `https://chatgpt.com/?q=` | +| `claude` | `https://claude.ai/new?q=` | +| `grok` | `https://grok.com/?q=` | | `reddit` | `https://www.reddit.com/search/?q=` | | `ppai` | `https://www.perplexity.ai/search/new?q=` | diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 4eb42be57..b04302ad6 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -33,6 +33,8 @@ function web_search() { packagist "https://packagist.org/?query=" gopkg "https://pkg.go.dev/search?m=package&q=" chatgpt "https://chatgpt.com/?q=" + grok "https://grok.com/?q=" + claude "https://claude.ai/new?q=" reddit "https://www.reddit.com/search/?q=" ppai "https://www.perplexity.ai/search/new?q=" ) @@ -89,6 +91,8 @@ alias npmpkg='web_search npmpkg' alias packagist='web_search packagist' alias gopkg='web_search gopkg' alias chatgpt='web_search chatgpt' +alias grok='web_search grok' +alias claude='web_search claude' alias reddit='web_search reddit' alias ppai='web_search ppai' @@ -108,3 +112,4 @@ if [[ ${#ZSH_WEB_SEARCH_ENGINES} -gt 0 ]]; then done unset engines key fi + From 13d4176a686507678ffd1b889838356f95f217e0 Mon Sep 17 00:00:00 2001 From: Gregory Menezes Date: Wed, 23 Jul 2025 16:16:18 +1000 Subject: [PATCH 63/82] fix(web-search): rename alias to `claudeai` to avoid conflict with CLI (#13224) --- plugins/web-search/README.md | 2 +- plugins/web-search/web-search.plugin.zsh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index 26017a533..bc017a1f1 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -52,7 +52,7 @@ Available search contexts are: | `packagist` | `https://packagist.org/?query=` | | `gopkg` | `https://pkg.go.dev/search?m=package&q=` | | `chatgpt` | `https://chatgpt.com/?q=` | -| `claude` | `https://claude.ai/new?q=` | +| `claudeai` | `https://claude.ai/new?q=` | | `grok` | `https://grok.com/?q=` | | `reddit` | `https://www.reddit.com/search/?q=` | | `ppai` | `https://www.perplexity.ai/search/new?q=` | diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index b04302ad6..14fc613bb 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -34,7 +34,7 @@ function web_search() { gopkg "https://pkg.go.dev/search?m=package&q=" chatgpt "https://chatgpt.com/?q=" grok "https://grok.com/?q=" - claude "https://claude.ai/new?q=" + claudeai "https://claude.ai/new?q=" reddit "https://www.reddit.com/search/?q=" ppai "https://www.perplexity.ai/search/new?q=" ) From 70f0e5285f802ce6eb7feea4588ff8917246233e Mon Sep 17 00:00:00 2001 From: Malav Bhavsar Date: Fri, 25 Jul 2025 00:53:51 -0700 Subject: [PATCH 64/82] fix(web-search): rename `claude` alias (#13229) Rename the 'claude' alias to 'claudeai' in the web-search plugin to prevent conflicts with the Claude CLI tool. This ensures users can access both the web search functionality and the Claude CLI without collision. --- plugins/web-search/web-search.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 14fc613bb..98826ef72 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -92,7 +92,7 @@ alias packagist='web_search packagist' alias gopkg='web_search gopkg' alias chatgpt='web_search chatgpt' alias grok='web_search grok' -alias claude='web_search claude' +alias claudeai='web_search claudeai' alias reddit='web_search reddit' alias ppai='web_search ppai' From 52f7ad6913cd039c32f4088d101c30db2492d518 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Jul 2025 18:55:43 +0200 Subject: [PATCH 65/82] chore(deps): bump certifi in /.github/workflows/dependencies (#13218) Bumps [certifi](https://github.com/certifi/python-certifi) from 2025.4.26 to 2025.7.14. - [Commits](https://github.com/certifi/python-certifi/compare/2025.04.26...2025.07.14) --- updated-dependencies: - dependency-name: certifi dependency-version: 2025.7.14 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 d2c8bdcc9..4c55ff760 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2025.4.26 +certifi==2025.7.14 charset-normalizer==3.4.2 idna==3.10 PyYAML==6.0.2 From 98a182d71b59a24d6b694d3e6b7a49212c06e04f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Mon, 28 Jul 2025 19:13:35 +0200 Subject: [PATCH 66/82] ci: add strict permissions to `dependencies.yml` workflow (#13232) Just use `contents:read` initial permission. The other permissions needed are those attached to the @ohmyzsh GitHub App. --- .github/workflows/dependencies.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 6c7387089..b4a17912b 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -4,6 +4,9 @@ on: schedule: - cron: "0 6 * * 0" +permissions: + contents: read + jobs: check: name: Check for updates From 5c804257ceb5b3062b876afae290adf72c474aad Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Mon, 28 Jul 2025 19:20:50 +0200 Subject: [PATCH 67/82] ci: use `actions/create-github-app-token` (#13233) --- .github/workflows/dependencies.yml | 10 +++++----- .github/workflows/project.yml | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index b4a17912b..0b8eeda93 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -18,11 +18,11 @@ jobs: with: fetch-depth: 0 - name: Authenticate as @ohmyzsh - id: generate_token - uses: ohmyzsh/github-app-token@v2 + id: generate-token + uses: actions/create-github-app-token@v2 with: - app_id: ${{ secrets.OHMYZSH_APP_ID }} - private_key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} + app-id: ${{ secrets.OHMYZSH_APP_ID }} + private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} - name: Setup Python uses: actions/setup-python@v5 with: @@ -30,7 +30,7 @@ jobs: cache: "pip" - name: Process dependencies env: - GH_TOKEN: ${{ steps.generate_token.outputs.token }} + GH_TOKEN: ${{ steps.generate-token.outputs.token }} GIT_APP_NAME: ohmyzsh[bot] GIT_APP_EMAIL: 54982679+ohmyzsh[bot]@users.noreply.github.com TMP_DIR: ${{ runner.temp }} diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml index 2c2a1cdaa..8fd4e15d4 100644 --- a/.github/workflows/project.yml +++ b/.github/workflows/project.yml @@ -17,13 +17,13 @@ jobs: if: github.repository == 'ohmyzsh/ohmyzsh' steps: - name: Authenticate as @ohmyzsh - id: generate_token - uses: ohmyzsh/github-app-token@v2 + id: generate-token + uses: actions/create-github-app-token@v2 with: - app_id: ${{ secrets.OHMYZSH_APP_ID }} - private_key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} + app-id: ${{ secrets.OHMYZSH_APP_ID }} + private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} - name: Store app token - run: echo "GH_TOKEN=${{ steps.generate_token.outputs.token }}" >> "$GITHUB_ENV" + run: echo "GH_TOKEN=${{ steps.generate-token.outputs.token }}" >> "$GITHUB_ENV" - name: Read project data env: ORGANIZATION: ohmyzsh From a6beb0f5958e935d33b0edb6d4470c3d7c4e8917 Mon Sep 17 00:00:00 2001 From: Parintorn Thammasitboon <159538649+parintorn0@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:08:48 +0700 Subject: [PATCH 68/82] feat(jonathan): add conda support (#13243) --- themes/jonathan.zsh-theme | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/themes/jonathan.zsh-theme b/themes/jonathan.zsh-theme index da6ed2281..5185ebf77 100644 --- a/themes/jonathan.zsh-theme +++ b/themes/jonathan.zsh-theme @@ -8,14 +8,15 @@ function theme_precmd { local rubypromptsize=${#${(%)$(ruby_prompt_info)}} local pwdsize=${#${(%):-%~}} local venvpromptsize=$((${#$(virtualenv_prompt_info)})) + local condapromptsize=$((${#$(conda_prompt_info)})) # Truncate the path if it's too long. - if (( promptsize + rubypromptsize + pwdsize + venvpromptsize > TERMWIDTH )); then + if (( promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize > TERMWIDTH )); then (( PR_PWDLEN = TERMWIDTH - promptsize )) elif [[ "${langinfo[CODESET]}" = UTF-8 ]]; then - PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize ) ))::${PR_HBAR}:)}" + PR_FILLBAR="\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::${PR_HBAR}:)}" else - PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize ) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}" + PR_FILLBAR="${PR_SHIFT_IN}\${(l:$(( TERMWIDTH - (promptsize + rubypromptsize + pwdsize + venvpromptsize + condapromptsize ) ))::${altchar[q]:--}:)}${PR_SHIFT_OUT}" fi } @@ -104,7 +105,7 @@ fi PROMPT='${PR_SET_CHARSET}${PR_STITLE}${(e)PR_TITLEBAR}\ ${PR_CYAN}${PR_ULCORNER}${PR_HBAR}${PR_GREY}(\ ${PR_GREEN}%${PR_PWDLEN}<...<%~%<<\ -${PR_GREY})$(virtualenv_prompt_info)$(ruby_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ +${PR_GREY})$(virtualenv_prompt_info)$(ruby_prompt_info)$(conda_prompt_info)${PR_CYAN}${PR_HBAR}${PR_HBAR}${(e)PR_FILLBAR}${PR_HBAR}${PR_GREY}(\ ${PR_CYAN}%(!.%SROOT%s.%n)${PR_GREY}@${PR_GREEN}%m:%l\ ${PR_GREY})${PR_CYAN}${PR_HBAR}${PR_URCORNER}\ From ef96242b9baad6b2211c386cb9af9418ace5d876 Mon Sep 17 00:00:00 2001 From: xusd320 Date: Thu, 7 Aug 2025 14:46:00 +0800 Subject: [PATCH 69/82] feat(web-search): add crates.io, docs.rs (#13250) --- plugins/web-search/web-search.plugin.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/web-search/web-search.plugin.zsh b/plugins/web-search/web-search.plugin.zsh index 98826ef72..93237f4e2 100644 --- a/plugins/web-search/web-search.plugin.zsh +++ b/plugins/web-search/web-search.plugin.zsh @@ -37,6 +37,8 @@ function web_search() { claudeai "https://claude.ai/new?q=" reddit "https://www.reddit.com/search/?q=" ppai "https://www.perplexity.ai/search/new?q=" + rscrate "https://crates.io/search?q=" + rsdoc "https://docs.rs/releases/search?query=" ) # check whether the search engine is supported @@ -95,6 +97,8 @@ alias grok='web_search grok' alias claudeai='web_search claudeai' alias reddit='web_search reddit' alias ppai='web_search ppai' +alias rscrate='web_search rscrate' +alias rsdoc='web_search rsdoc' #add your own !bang searches here alias wiki='web_search duckduckgo \!w' From 9d8d4cf41482a95127ca41faecc0a7ee0781ca2e Mon Sep 17 00:00:00 2001 From: drjaska <88596812+drjaska@users.noreply.github.com> Date: Fri, 8 Aug 2025 12:23:24 +0300 Subject: [PATCH 70/82] feat(extract): support `.pk{3,4,7}` files (#13254) --- plugins/extract/README.md | 97 +++++++++++++++--------------- plugins/extract/_extract | 3 + plugins/extract/extract.plugin.zsh | 4 +- 3 files changed, 55 insertions(+), 49 deletions(-) diff --git a/plugins/extract/README.md b/plugins/extract/README.md index e0f571521..7bedfb1c6 100644 --- a/plugins/extract/README.md +++ b/plugins/extract/README.md @@ -14,53 +14,56 @@ plugins=(... extract) ## Supported file extensions -| Extension | Description | -| :---------------- | :----------------------------------- | -| `7z` | 7zip file | -| `Z` | Z archive (LZW) | -| `apk` | Android app file | -| `aar` | Android library file | -| `bz2` | Bzip2 file | -| `cab` | Microsoft cabinet archive | -| `cpio` | Cpio archive | -| `deb` | Debian package | -| `ear` | Enterprise Application aRchive | -| `exe` | Windows executable file | -| `gz` | Gzip file | -| `ipa` | iOS app package | -| `ipsw` | iOS firmware file | -| `jar` | Java Archive | -| `lrz` | LRZ archive | -| `lz4` | LZ4 archive | -| `lzma` | LZMA archive | -| `obscpio` | cpio archive used on OBS | -| `rar` | WinRAR archive | -| `rpm` | RPM package | -| `sublime-package` | Sublime Text package | -| `tar` | Tarball | -| `tar.bz2` | Tarball with bzip2 compression | -| `tar.gz` | Tarball with gzip compression | -| `tar.lrz` | Tarball with lrzip compression | -| `tar.lz` | Tarball with lzip compression | -| `tar.lz4` | Tarball with lz4 compression | -| `tar.xz` | Tarball with lzma2 compression | -| `tar.zma` | Tarball with lzma compression | -| `tar.zst` | Tarball with zstd compression | -| `tbz` | Tarball with bzip compression | -| `tbz2` | Tarball with bzip2 compression | -| `tgz` | Tarball with gzip compression | -| `tlz` | Tarball with lzma compression | -| `txz` | Tarball with lzma2 compression | -| `tzst` | Tarball with zstd compression | -| `vsix` | VS Code extension zip file | -| `war` | Web Application archive (Java-based) | -| `whl` | Python wheel file | -| `xpi` | Mozilla XPI module file | -| `xz` | LZMA2 archive | -| `zip` | Zip archive | -| `zlib` | zlib archive | -| `zst` | Zstandard file (zstd) | -| `zpaq` | Zpaq file | +| Extension | Description | +| :---------------- | :-------------------------------------- | +| `7z` | 7zip file | +| `apk` | Android app file | +| `aar` | Android library file | +| `bz2` | Bzip2 file | +| `cab` | Microsoft cabinet archive | +| `cpio` | Cpio archive | +| `deb` | Debian package | +| `ear` | Enterprise Application aRchive | +| `exe` | Windows executable file | +| `gz` | Gzip file | +| `ipa` | iOS app package | +| `ipsw` | iOS firmware file | +| `jar` | Java Archive | +| `lrz` | LRZ archive | +| `lz4` | LZ4 archive | +| `lzma` | LZMA archive | +| `obscpio` | cpio archive used on OBS | +| `pk3` | Renamed Zip archive used by Quake games | +| `pk4` | Renamed Zip archive used by Quake games | +| `pk7` | Renamed 7zip file used by Quake games | +| `rar` | WinRAR archive | +| `rpm` | RPM package | +| `sublime-package` | Sublime Text package | +| `tar` | Tarball | +| `tar.bz2` | Tarball with bzip2 compression | +| `tar.gz` | Tarball with gzip compression | +| `tar.lrz` | Tarball with lrzip compression | +| `tar.lz` | Tarball with lzip compression | +| `tar.lz4` | Tarball with lz4 compression | +| `tar.xz` | Tarball with lzma2 compression | +| `tar.zma` | Tarball with lzma compression | +| `tar.zst` | Tarball with zstd compression | +| `tbz` | Tarball with bzip compression | +| `tbz2` | Tarball with bzip2 compression | +| `tgz` | Tarball with gzip compression | +| `tlz` | Tarball with lzma compression | +| `txz` | Tarball with lzma2 compression | +| `tzst` | Tarball with zstd compression | +| `vsix` | VS Code extension zip file | +| `war` | Web Application archive (Java-based) | +| `whl` | Python wheel file | +| `xpi` | Mozilla XPI module file | +| `xz` | LZMA2 archive | +| `Z` | Z archive (LZW) | +| `zip` | Zip archive | +| `zlib` | zlib archive | +| `zst` | Zstandard file (zstd) | +| `zpaq` | Zpaq file | See [list of archive formats](https://en.wikipedia.org/wiki/List_of_archive_formats) for more information regarding archive formats. diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 0b43e86bc..6641443d3 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -19,6 +19,9 @@ local -a exts=( lz4 lzma obscpio + pk3 + pk4 + pk7 rar rpm sublime-package diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh index aa3fd00e6..d8cbc8b94 100644 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -76,11 +76,11 @@ EOF (*.lz4) lz4 -d "$full_path" ;; (*.lzma) unlzma "$full_path" ;; (*.z) uncompress "$full_path" ;; - (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx) unzip "$full_path" ;; + (*.zip|*.war|*.jar|*.ear|*.sublime-package|*.ipa|*.ipsw|*.xpi|*.apk|*.aar|*.whl|*.vsix|*.crx|*.pk3|*.pk4) unzip "$full_path" ;; (*.rar) unrar x -ad "$full_path" ;; (*.rpm) rpm2cpio "$full_path" | cpio --quiet -id ;; - (*.7z | *.7z.[0-9]*) 7za x "$full_path" ;; + (*.7z | *.7z.[0-9]* | *.pk7) 7za x "$full_path" ;; (*.deb) command mkdir -p "control" "data" ar vx "$full_path" > /dev/null From 73024e8f0849ff22ea15dee1d7c38157cefc77d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 10:25:23 +0200 Subject: [PATCH 71/82] chore(deps): bump charset-normalizer in /.github/workflows/dependencies (#13257) Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.2 to 3.4.3. - [Release notes](https://github.com/jawah/charset_normalizer/releases) - [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md) - [Commits](https://github.com/jawah/charset_normalizer/compare/3.4.2...3.4.3) --- updated-dependencies: - dependency-name: charset-normalizer dependency-version: 3.4.3 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 4c55ff760..167f9df8f 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,5 +1,5 @@ certifi==2025.7.14 -charset-normalizer==3.4.2 +charset-normalizer==3.4.3 idna==3.10 PyYAML==6.0.2 requests==2.32.4 From 9fe2c26abd3f476a3377bf37b513e5cabf3f3637 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:47:37 +0200 Subject: [PATCH 72/82] chore(deps): bump certifi in /.github/workflows/dependencies (#13246) 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 167f9df8f..09bebefbd 100644 --- a/.github/workflows/dependencies/requirements.txt +++ b/.github/workflows/dependencies/requirements.txt @@ -1,4 +1,4 @@ -certifi==2025.7.14 +certifi==2025.8.3 charset-normalizer==3.4.3 idna==3.10 PyYAML==6.0.2 From 801f09c1caf6d3ea8f5d41dea3bdc1c70d7ea913 Mon Sep 17 00:00:00 2001 From: Jacob Rogers Date: Tue, 12 Aug 2025 20:37:03 +1200 Subject: [PATCH 73/82] fix(poetry-env): add support for poetry 2 (#13260) --- plugins/poetry-env/poetry-env.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/poetry-env/poetry-env.plugin.zsh b/plugins/poetry-env/poetry-env.plugin.zsh index dca388dfe..d2d571dbe 100644 --- a/plugins/poetry-env/poetry-env.plugin.zsh +++ b/plugins/poetry-env/poetry-env.plugin.zsh @@ -1,7 +1,7 @@ _togglePoetryShell() { # Determine if currently in a Poetry-managed directory local in_poetry_dir=0 - if [[ -f "$PWD/pyproject.toml" ]] && grep -q 'tool.poetry' "$PWD/pyproject.toml"; then + if [[ -f "$PWD/pyproject.toml" && -f "$PWD/poetry.lock" ]]; then in_poetry_dir=1 fi From 2423b7a12dc4624a2d8a7c58be4ac75cb82fd8c7 Mon Sep 17 00:00:00 2001 From: lucas Date: Wed, 13 Aug 2025 05:14:21 -0300 Subject: [PATCH 74/82] docs(web-search): add missing entries (#13263) --- plugins/web-search/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/web-search/README.md b/plugins/web-search/README.md index bc017a1f1..8d74a08c0 100644 --- a/plugins/web-search/README.md +++ b/plugins/web-search/README.md @@ -56,6 +56,8 @@ Available search contexts are: | `grok` | `https://grok.com/?q=` | | `reddit` | `https://www.reddit.com/search/?q=` | | `ppai` | `https://www.perplexity.ai/search/new?q=` | +| `rscrate` | `https://crates.io/search?q=` | +| `rsdoc` | `https://docs.rs/releases/search?query=` | Also there are aliases for bang-searching DuckDuckGo: From 8bd49fb0475c8be9a9d0f5daa518a8ff3bbe78fb Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 16 Aug 2025 18:27:50 +0200 Subject: [PATCH 75/82] fix(virtualenv): take into account `$VIRTUAL_ENV_PROMPT` Closes #13262 --- plugins/virtualenv/virtualenv.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/virtualenv/virtualenv.plugin.zsh b/plugins/virtualenv/virtualenv.plugin.zsh index 56707bb98..e339ef956 100644 --- a/plugins/virtualenv/virtualenv.plugin.zsh +++ b/plugins/virtualenv/virtualenv.plugin.zsh @@ -1,6 +1,6 @@ function virtualenv_prompt_info(){ [[ -n ${VIRTUAL_ENV} ]] || return - echo "${ZSH_THEME_VIRTUALENV_PREFIX=[}${VIRTUAL_ENV:t:gs/%/%%}${ZSH_THEME_VIRTUALENV_SUFFIX=]}" + echo "${ZSH_THEME_VIRTUALENV_PREFIX=[}${VIRTUAL_ENV_PROMPT:-${VIRTUAL_ENV:t:gs/%/%%}}${ZSH_THEME_VIRTUALENV_SUFFIX=]}" } # disables prompt mangling in virtual_env/bin/activate From 51760e1d4aa417846b41a32ad845aaacc053a7f5 Mon Sep 17 00:00:00 2001 From: olwooz <24418404+olwooz@users.noreply.github.com> Date: Sun, 17 Aug 2025 01:29:43 +0900 Subject: [PATCH 76/82] feat(installer): add confirmation before overwriting existing .zshrc (#13086) --- tools/install.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/install.sh b/tools/install.sh index 5c9b2c18d..d274c2c9f 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -341,6 +341,23 @@ setup_zshrc() { echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Keeping...${FMT_RESET}" return fi + + # Ask user for confirmation before backing up and overwriting + echo "${FMT_YELLOW}Found ${zdot}/.zshrc." + echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" + printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ + "$FMT_YELLOW" "$FMT_RESET" + read -r opt + case $opt in + [Yy]*|"") ;; + [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; + *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; + esac + if [ -e "$OLD_ZSHRC" ]; then OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" if [ -e "$OLD_OLD_ZSHRC" ]; then @@ -353,7 +370,7 @@ setup_zshrc() { echo "${FMT_YELLOW}Found old .zshrc.pre-oh-my-zsh." \ "${FMT_GREEN}Backing up to ${OLD_OLD_ZSHRC}${FMT_RESET}" fi - echo "${FMT_YELLOW}Found ${zdot}/.zshrc.${FMT_RESET} ${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}" + echo "${FMT_GREEN}Backing up to ${OLD_ZSHRC}${FMT_RESET}" mv "$zdot/.zshrc" "$OLD_ZSHRC" fi From 5d37f723f6c92d9fe043ea9f0aa460cd0bd0258a Mon Sep 17 00:00:00 2001 From: "Patrick W. Healy" Date: Sat, 16 Aug 2025 14:17:14 -0500 Subject: [PATCH 77/82] fix(asdf): avoid prepending path entry multiple times (#13268) --- plugins/asdf/asdf.plugin.zsh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/asdf/asdf.plugin.zsh b/plugins/asdf/asdf.plugin.zsh index 318267dcb..913949888 100644 --- a/plugins/asdf/asdf.plugin.zsh +++ b/plugins/asdf/asdf.plugin.zsh @@ -1,7 +1,9 @@ (( ! $+commands[asdf] )) && return export ASDF_DATA_DIR="${ASDF_DATA_DIR:-$HOME/.asdf}" -path=("$ASDF_DATA_DIR/shims" $path) + +# Add shims to the front of the path, removing if already present. +path=("$ASDF_DATA_DIR/shims" ${path:#$ASDF_DATA_DIR/shims}) # 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. From 92a03105acd514fe81fb3a1f581ff0daeb11cead Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Sat, 16 Aug 2025 21:26:22 +0200 Subject: [PATCH 78/82] docs(key-bindings): clarify comment Closes #13265 --- lib/key-bindings.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/key-bindings.zsh b/lib/key-bindings.zsh index a5650dd81..bf5d4ba30 100644 --- a/lib/key-bindings.zsh +++ b/lib/key-bindings.zsh @@ -117,7 +117,7 @@ bindkey '^r' history-incremental-search-backward # [Ctrl-r] - Search backwa bindkey ' ' magic-space # [Space] - don't do history expansion -# Edit the current command line in $EDITOR +# Edit the current command line in $VISUAL (or $EDITOR / `vi` if not set) autoload -U edit-command-line zle -N edit-command-line bindkey '\C-x\C-e' edit-command-line From 7504f22a0ce649ab577a6232f2a673ea98d773a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my?= Date: Sat, 16 Aug 2025 21:28:32 +0200 Subject: [PATCH 79/82] feat(battery): add wattage for macOS (#13258) --- plugins/battery/README.md | 6 ++++++ plugins/battery/battery.plugin.zsh | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/plugins/battery/README.md b/plugins/battery/README.md index 73fcb693e..07e4e0b16 100644 --- a/plugins/battery/README.md +++ b/plugins/battery/README.md @@ -19,6 +19,12 @@ For example: BATTERY_CHARGING="⚡️" ``` +You can see the power of your charger using the following setting (MacOS only) + +```zsh +BATTERY_SHOW_WATTS=true +``` + ## Requirements - On Linux, you must have the `acpi` or `acpitool` commands installed on your operating system. diff --git a/plugins/battery/battery.plugin.zsh b/plugins/battery/battery.plugin.zsh index 7977e4d04..c7618f6b3 100644 --- a/plugins/battery/battery.plugin.zsh +++ b/plugins/battery/battery.plugin.zsh @@ -17,8 +17,13 @@ # Modified to add support for OpenBSD # ########################################### +: ${BATTERY_SHOW_WATTS:=false} + if [[ "$OSTYPE" = darwin* ]]; then + function get_charger_power() { + echo "$(ioreg -rc AppleSmartBattery | grep -o '"Watts"=[0-9]\+' | head -1 | grep -o '[0-9]\+')W " + } function battery_is_charging() { ioreg -rc AppleSmartBattery | command grep -q '^.*"ExternalConnected"\ =\ Yes' } @@ -58,7 +63,10 @@ if [[ "$OSTYPE" = darwin* ]]; then fi echo "%{$fg[$color]%}[${battery_pct}%%]%{$reset_color%}" else - echo "${BATTERY_CHARGING-⚡️}" + if [[ "${BATTERY_SHOW_WATTS}" = "true" ]] ; then + watts=$(get_charger_power) + fi + echo "${watts}${BATTERY_CHARGING-⚡️}" fi } From 736632228a5f39573a15f4533b7672851f30bbe6 Mon Sep 17 00:00:00 2001 From: 0xHouss <67522466+0xHouss@users.noreply.github.com> Date: Sat, 16 Aug 2025 20:31:40 +0100 Subject: [PATCH 80/82] feat(copyfile): add error handling (#13248) --- plugins/copyfile/copyfile.plugin.zsh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/copyfile/copyfile.plugin.zsh b/plugins/copyfile/copyfile.plugin.zsh index f4eca5acf..3281410e5 100644 --- a/plugins/copyfile/copyfile.plugin.zsh +++ b/plugins/copyfile/copyfile.plugin.zsh @@ -1,7 +1,19 @@ # Copies the contents of a given file to the system or X Windows clipboard # -# copyfile +# Usage: copyfile function copyfile { emulate -L zsh + + if [[ -z "$1" ]]; then + echo "Usage: copyfile " + return 1 + fi + + if [[ ! -f "$1" ]]; then + echo "Error: '$1' is not a valid file." + return 1 + fi + clipcopy $1 + echo ${(%):-"%B$1%b copied to clipboard."} } From c2a69fe5904e074f0049a941c09f039acdce40a3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Aug 2025 08:32:18 +0200 Subject: [PATCH 81/82] chore(deps): bump actions/checkout from 4 to 5 (#13271) Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' 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.yml | 2 +- .github/workflows/installer.yml | 4 ++-- .github/workflows/main.yml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 0b8eeda93..7cc53371d 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -14,7 +14,7 @@ jobs: if: github.repository == 'ohmyzsh/ohmyzsh' steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0 - name: Authenticate as @ohmyzsh diff --git a/.github/workflows/installer.yml b/.github/workflows/installer.yml index 5593c9175..9e933350f 100644 --- a/.github/workflows/installer.yml +++ b/.github/workflows/installer.yml @@ -26,7 +26,7 @@ jobs: - macos-latest steps: - name: Set up git repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install zsh if: runner.os == 'Linux' run: sudo apt-get update; sudo apt-get install zsh @@ -42,7 +42,7 @@ jobs: - test steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install Vercel CLI run: npm install -g vercel - name: Setup project and deploy diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 264ac31f3..c49324495 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: if: github.repository == 'ohmyzsh/ohmyzsh' steps: - name: Set up git repository - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Install zsh run: sudo apt-get update; sudo apt-get install zsh - name: Check syntax From cef64c465aa81b68fbbec5b008eeae1cb63805d3 Mon Sep 17 00:00:00 2001 From: Carlo Sala Date: Tue, 19 Aug 2025 12:46:13 +0200 Subject: [PATCH 82/82] fix(install): ensure `--unattended` is respected (#13275) Closes #13274 --- tools/install.sh | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index d274c2c9f..8cf62a76e 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -25,9 +25,10 @@ # BRANCH - branch to check out immediately after install (default: master) # # Other options: -# CHSH - 'no' means the installer will not change the default shell (default: yes) -# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes) -# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no) +# CHSH - 'no' means the installer will not change the default shell (default: yes) +# RUNZSH - 'no' means the installer will not run zsh after the install (default: yes) +# KEEP_ZSHRC - 'yes' means the installer will not replace an existing .zshrc (default: no) +# OVERWRITE_CONFIRMATION - 'no' means the installer will not ask for confirmation to overwrite the existing .zshrc (default: yes) # # You can also pass some arguments to the install script to set some these options: # --skip-chsh: has the same behavior as setting CHSH to 'no' @@ -77,6 +78,7 @@ BRANCH=${BRANCH:-master} CHSH=${CHSH:-yes} RUNZSH=${RUNZSH:-yes} KEEP_ZSHRC=${KEEP_ZSHRC:-no} +OVERWRITE_CONFIRMATION=${OVERWRITE_CONFIRMATION:-yes} command_exists() { @@ -342,21 +344,23 @@ setup_zshrc() { return fi - # Ask user for confirmation before backing up and overwriting - echo "${FMT_YELLOW}Found ${zdot}/.zshrc." - echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." - echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" - echo "----------------------------------------" - cat "$ZSH/templates/minimal.zshrc" - echo "----------------------------------------" - printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ - "$FMT_YELLOW" "$FMT_RESET" - read -r opt - case $opt in - [Yy]*|"") ;; - [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; - *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; - esac + if [ $OVERWRITE_CONFIRMATION != "no" ]; then + # Ask user for confirmation before backing up and overwriting + echo "${FMT_YELLOW}Found ${zdot}/.zshrc." + echo "The existing .zshrc will be backed up to .zshrc.pre-oh-my-zsh if overwritten." + echo "Make sure your .zshrc contains the following minimal configuration if you choose not to overwrite it:${FMT_RESET}" + echo "----------------------------------------" + cat "$ZSH/templates/minimal.zshrc" + echo "----------------------------------------" + printf '%sDo you want to overwrite it with the Oh My Zsh template? [Y/n]%s ' \ + "$FMT_YELLOW" "$FMT_RESET" + read -r opt + case $opt in + [Yy]*|"") ;; + [Nn]*) echo "Overwrite skipped. Existing .zshrc will be kept."; return ;; + *) echo "Invalid choice. Overwrite skipped. Existing .zshrc will be kept."; return ;; + esac + fi if [ -e "$OLD_ZSHRC" ]; then OLD_OLD_ZSHRC="${OLD_ZSHRC}-$(date +%Y-%m-%d_%H-%M-%S)" @@ -510,12 +514,13 @@ main() { if [ ! -t 0 ]; then RUNZSH=no CHSH=no + OVERWRITE_CONFIRMATION=no fi # Parse arguments while [ $# -gt 0 ]; do case $1 in - --unattended) RUNZSH=no; CHSH=no ;; + --unattended) RUNZSH=no; CHSH=no; OVERWRITE_CONFIRMATION=no ;; --skip-chsh) CHSH=no ;; --keep-zshrc) KEEP_ZSHRC=yes ;; esac