From 88242d26e9395790d14dfe0a8fe82e54030a0623 Mon Sep 17 00:00:00 2001 From: Dylan Roman Date: Fri, 24 Apr 2026 13:47:00 -0400 Subject: [PATCH 1/3] fix(git): replace deprecated syntax for percent substitution in prompt (#13705) --- lib/git.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/git.zsh b/lib/git.zsh index 8d38f3268..7345be818 100644 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -36,7 +36,7 @@ function _omz_git_prompt_info() { && upstream=" -> ${upstream}" fi - echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref:gs/%/%%}${upstream:gs/%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" + echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${ref//\%/%%}${upstream//\%/%%}$(parse_git_dirty)${ZSH_THEME_GIT_PROMPT_SUFFIX}" } function _omz_git_prompt_status() { From a5d42521f42422a09b8be7f89f49a58f3d260831 Mon Sep 17 00:00:00 2001 From: Dylan Roman Date: Fri, 8 May 2026 08:42:21 -0400 Subject: [PATCH 2/3] feat(extract): add support for extracting to a specified directory --- plugins/extract/extract.plugin.zsh | 39 +++++++++++++++++++++++++++--- 1 file changed, 35 insertions(+), 4 deletions(-) mode change 100644 => 100755 plugins/extract/extract.plugin.zsh diff --git a/plugins/extract/extract.plugin.zsh b/plugins/extract/extract.plugin.zsh old mode 100644 new mode 100755 index aed77e7d7..cfca62251 --- a/plugins/extract/extract.plugin.zsh +++ b/plugins/extract/extract.plugin.zsh @@ -9,14 +9,41 @@ Usage: extract [-option] [file ...] Options: -r, --remove Remove archive after unpacking. + -t, --to-directory Extract to a specific directory instead of the current one. EOF fi local remove_archive=1 - if [[ "$1" == "-r" ]] || [[ "$1" == "--remove" ]]; then - remove_archive=0 - shift - fi + local target_directory="" + + while (( $# > 0 )); do + case "$1" in + -r|--remove) + remove_archive=0 + shift + ;; + -t|--to-directory) + shift + if (( $# == 0 )); then + echo "extract: -t/--to-directory requires a directory argument" >&2 + return 1 + fi + + target_directory="$1" + shift + + if [[ ! -d "$target_directory" ]]; then + echo "extract: '$target_directory' is not a valid directory" >&2 + return 1 + fi + + target_directory="${target_directory%/}" + ;; + *) + break + ;; + esac + done local pwd="$PWD" while (( $# > 0 )); do @@ -35,6 +62,10 @@ EOF extract_dir="${extract_dir:r}" fi + if [[ -n "$target_directory" ]]; then + extract_dir="$target_directory/${extract_dir:t}" + fi + # If there's a file or directory with the same name as the archive # add a random string to the end of the extract directory if [[ -e "$extract_dir" ]]; then From 0b899f137bc782bd01c6c3ff4efdb8628562ad03 Mon Sep 17 00:00:00 2001 From: Dylan Roman Date: Fri, 8 May 2026 08:42:54 -0400 Subject: [PATCH 3/3] feat(extract): add option to extract to a specific directory in _extract --- plugins/extract/_extract | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/extract/_extract b/plugins/extract/_extract index 6641443d3..7d71aeb1b 100644 --- a/plugins/extract/_extract +++ b/plugins/extract/_extract @@ -53,5 +53,6 @@ local -a exts=( _arguments \ '(-r --remove)'{-r,--remove}'[Remove archive.]' \ + '(-t --to-directory)'{-t,--to-directory}'[Extract to a specific directory.]' \ "*::archive file:_files -g '(#i)*.(${(j:|:)exts})(-.)'" \ && return 0