From 2c06852546f52330c389b53a1b81348e62f64423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 16 Nov 2021 17:18:07 +0100 Subject: [PATCH 1/9] style(dirhistory): remove use of `eval` completely --- plugins/dirhistory/dirhistory.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dirhistory/dirhistory.plugin.zsh b/plugins/dirhistory/dirhistory.plugin.zsh index e3f45ee99..9f39264cf 100644 --- a/plugins/dirhistory/dirhistory.plugin.zsh +++ b/plugins/dirhistory/dirhistory.plugin.zsh @@ -19,14 +19,14 @@ export DIRHISTORY_SIZE=30 # Returns the element if the array was not empty, # otherwise returns empty string. function pop_past() { - eval "$1=${(q)dirhistory_past[$#dirhistory_past]}" + print -v $1 "${dirhistory_past[$#dirhistory_past]}" if [[ $#dirhistory_past -gt 0 ]]; then dirhistory_past[$#dirhistory_past]=() fi } function pop_future() { - eval "$1=${(q)dirhistory_future[$#dirhistory_future]}" + print -v $1 "${dirhistory_future[$#dirhistory_future]}" if [[ $#dirhistory_future -gt 0 ]]; then dirhistory_future[$#dirhistory_future]=() fi From fb12e4135311b9c4189a7e4556be619922052f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 16 Nov 2021 18:38:59 +0100 Subject: [PATCH 2/9] fix(install): fix backslash in `printf` when showing logo (#10422) Fixes #10422 --- tools/install.sh | 10 +++++----- tools/upgrade.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/install.sh b/tools/install.sh index ca996f8a7..47166059d 100755 --- a/tools/install.sh +++ b/tools/install.sh @@ -339,11 +339,11 @@ EOF # shellcheck disable=SC2183 # printf string has more %s than arguments ($RAINBOW expands to multiple arguments) print_success() { - printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET - printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET - printf '%s / __ \%s/ __ \ %s / __ `__ \%s/ / / / %s /_ / %s/ ___/%s __ \ %s\n' $RAINBOW $RESET - printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET - printf '%s\____/%s_/ /_/ %s /_/ /_/ /_/%s\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET + printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET + printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET + printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET + printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET + printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET printf '%s %s %s %s /____/ %s %s %s %s....is now installed!%s\n' $RAINBOW $GREEN $RESET printf '\n' printf '\n' diff --git a/tools/upgrade.sh b/tools/upgrade.sh index 7642858fe..994ffe9c9 100755 --- a/tools/upgrade.sh +++ b/tools/upgrade.sh @@ -182,12 +182,12 @@ if git pull --rebase --stat $remote $branch; then printf "${BLUE}%s \`${BOLD}%s${RESET}${BLUE}\`${RESET}\n" "You can see the changelog with" "omz changelog" fi - printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET - printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET - printf '%s / __ \%s/ __ \ %s / __ `__ \%s/ / / / %s /_ / %s/ ___/%s __ \ %s\n' $RAINBOW $RESET - printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET - printf '%s\____/%s_/ /_/ %s /_/ /_/ /_/%s\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET - printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET + printf '%s %s__ %s %s %s %s %s__ %s\n' $RAINBOW $RESET + printf '%s ____ %s/ /_ %s ____ ___ %s__ __ %s ____ %s_____%s/ /_ %s\n' $RAINBOW $RESET + printf '%s / __ \\%s/ __ \\ %s / __ `__ \\%s/ / / / %s /_ / %s/ ___/%s __ \\ %s\n' $RAINBOW $RESET + printf '%s/ /_/ /%s / / / %s / / / / / /%s /_/ / %s / /_%s(__ )%s / / / %s\n' $RAINBOW $RESET + printf '%s\\____/%s_/ /_/ %s /_/ /_/ /_/%s\\__, / %s /___/%s____/%s_/ /_/ %s\n' $RAINBOW $RESET + printf '%s %s %s %s /____/ %s %s %s %s\n' $RAINBOW $RESET printf '\n' printf "${BLUE}%s${RESET}\n\n" "$message" printf "${BLUE}${BOLD}%s %s${RESET}\n" "To keep up with the latest news and updates, follow us on Twitter:" "$(fmt_link @ohmyzsh https://twitter.com/ohmyzsh)" From 60b89cd264a5d889573704f5116cefc8e690062c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Nov 2021 09:55:39 +0100 Subject: [PATCH 3/9] feat(ssh-agent): add `quiet` option to silence plugin (#9659) Closes #9659 Co-authored-by: Jeff Warner --- plugins/ssh-agent/README.md | 56 +++++++++++++++----------- plugins/ssh-agent/ssh-agent.plugin.zsh | 12 +++--- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/plugins/ssh-agent/README.md b/plugins/ssh-agent/README.md index 1d6914ec6..fa6a996d4 100644 --- a/plugins/ssh-agent/README.md +++ b/plugins/ssh-agent/README.md @@ -13,28 +13,24 @@ plugins=(... ssh-agent) **IMPORTANT: put these settings _before_ the line that sources oh-my-zsh** +### `agent-forwarding` + To enable **agent forwarding support** add the following to your zshrc file: ```zsh -zstyle :omz:plugins:ssh-agent agent-forwarding on +zstyle :omz:plugins:ssh-agent agent-forwarding yes ``` ----- +### `helper` -To **NOT load any identities on start** use the `lazy` setting. This is particularly -useful when combined with the `AddKeysToAgent` setting (available since OpenSSH 7.2), -since it allows to enter the password only on first use. _NOTE: you can know your -OpenSSH version with `ssh -V`._ +To set an **external helper** to ask for the passwords and possibly store +them in the system keychain use the `helper` style. For example: ```zsh -zstyle :omz:plugins:ssh-agent lazy yes +zstyle :omz:plugins:ssh-agent helper ksshaskpass ``` -You can enable `AddKeysToAgent` by passing `-o AddKeysToAgent=yes` to the `ssh` command, -or by adding `AddKeysToAgent yes` to your `~/.ssh/config` file [1]. -See the [OpenSSH 7.2 Release Notes](http://www.openssh.com/txt/release-7.2). - ----- +### `identities` To **load multiple identities** use the `identities` style (**this has no effect if the `lazy` setting is enabled**). For example: @@ -52,7 +48,22 @@ zstyle :omz:plugins:ssh-agent identities ~/.config/ssh/id_rsa ~/.config/ssh/id_r zstyle :omz:plugins:ssh-agent identities ~/.config/ssh/{id_rsa,id_rsa2,id_github} ``` ----- +### `lazy` + +To **NOT load any identities on start** use the `lazy` setting. This is particularly +useful when combined with the `AddKeysToAgent` setting (available since OpenSSH 7.2), +since it allows to enter the password only on first use. _NOTE: you can know your +OpenSSH version with `ssh -V`._ + +```zsh +zstyle :omz:plugins:ssh-agent lazy yes +``` + +You can enable `AddKeysToAgent` by passing `-o AddKeysToAgent=yes` to the `ssh` command, +or by adding `AddKeysToAgent yes` to your `~/.ssh/config` file [1]. +See the [OpenSSH 7.2 Release Notes](http://www.openssh.com/txt/release-7.2). + +### `lifetime` To **set the maximum lifetime of the identities**, use the `lifetime` style. The lifetime may be specified in seconds or as described in sshd_config(5) @@ -62,7 +73,15 @@ The lifetime may be specified in seconds or as described in sshd_config(5) zstyle :omz:plugins:ssh-agent lifetime 4h ``` ----- +### `quiet` + +To silence the plugin, use the following setting: + +```zsh +zstyle :omz:plugins:ssh-agent quiet yes +``` + +### `ssh-add-args` To **pass arguments to the `ssh-add` command** that adds the identities on startup, use the `ssh-add-args` setting. You can pass multiple arguments separated by spaces: @@ -80,15 +99,6 @@ ssh-add -K -c -a /run/user/1000/ssh-auth For valid `ssh-add` arguments run `ssh-add --help` or `man ssh-add`. ----- - -To set an **external helper** to ask for the passwords and possibly store -them in the system keychain use the `helper` style. For example: - -```zsh -zstyle :omz:plugins:ssh-agent helper ksshaskpass -``` - ## Credits Based on code from Joseph M. Reagle: https://www.cygwin.com/ml/cygwin/2001-06/msg00537.html diff --git a/plugins/ssh-agent/ssh-agent.plugin.zsh b/plugins/ssh-agent/ssh-agent.plugin.zsh index 47dfef5b0..0d6a35b35 100644 --- a/plugins/ssh-agent/ssh-agent.plugin.zsh +++ b/plugins/ssh-agent/ssh-agent.plugin.zsh @@ -18,7 +18,7 @@ function _start_agent() { zstyle -s :omz:plugins:ssh-agent lifetime lifetime # start ssh-agent and setup environment - echo Starting ssh-agent... + zstyle -t :omz:plugins:ssh-agent quiet || echo >&2 "Starting ssh-agent ..." ssh-agent -s ${lifetime:+-t} ${lifetime} | sed '/^echo/d' >! "$ssh_env_cache" chmod 600 "$ssh_env_cache" . "$ssh_env_cache" > /dev/null @@ -78,7 +78,7 @@ function _add_identities() { if [[ -n "$helper" ]]; then if [[ -z "${commands[$helper]}" ]]; then - echo "ssh-agent: the helper '$helper' has not been found." + echo >&2 "ssh-agent: the helper '$helper' has not been found." else SSH_ASKPASS="$helper" ssh-add "${args[@]}" ${^not_loaded} < /dev/null return $? @@ -88,11 +88,9 @@ function _add_identities() { ssh-add "${args[@]}" ${^not_loaded} } -# test if agent-forwarding is enabled -zstyle -b :omz:plugins:ssh-agent agent-forwarding agent_forwarding - -# Add a nifty symlink for screen/tmux if agent forwarding -if [[ $agent_forwarding = "yes" && -n "$SSH_AUTH_SOCK" && ! -L "$SSH_AUTH_SOCK" ]]; then +# Add a nifty symlink for screen/tmux if agent forwarding is enabled +if zstyle -t :omz:plugins:ssh-agent agent-forwarding \ + && [[ -n "$SSH_AUTH_SOCK" && ! -L "$SSH_AUTH_SOCK" ]]; then ln -sf "$SSH_AUTH_SOCK" /tmp/ssh-agent-$USERNAME-screen else _start_agent From 2b379ec42c8675d6076737e1373767c160f5ae70 Mon Sep 17 00:00:00 2001 From: Brian Tannous Date: Wed, 17 Nov 2021 01:33:48 -0800 Subject: [PATCH 4/9] feat(kn): add plugin for `kn` completion (#8927) --- plugins/kn/README.md | 17 +++++++++++++++++ plugins/kn/kn.plugin.zsh | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100644 plugins/kn/README.md create mode 100644 plugins/kn/kn.plugin.zsh diff --git a/plugins/kn/README.md b/plugins/kn/README.md new file mode 100644 index 000000000..d2eb9b31d --- /dev/null +++ b/plugins/kn/README.md @@ -0,0 +1,17 @@ +# kn - Knative CLI + +This plugin provides autocompletion for [kn](https://knative.dev/docs/install/client/install-kn/) operations. + +To use it, add `kn` to the plugins array of your zshrc file: + +```zsh +plugins=(... kn) +``` + +## See Also + ++ [kn/client](https://github.com/knative/client) + +## Contributors + ++ [btannous](https://github.com/btannous) - Plugin Author diff --git a/plugins/kn/kn.plugin.zsh b/plugins/kn/kn.plugin.zsh new file mode 100644 index 000000000..f60177dd9 --- /dev/null +++ b/plugins/kn/kn.plugin.zsh @@ -0,0 +1,8 @@ +# Autocompletion for kn, the command line interface for knative +# +# Author: https://github.com/btannous + +if [ $commands[kn] ]; then + source <(kn completion zsh) + compdef _kn kn +fi From b60b3f184275c39800dd7284d6904fcf295b3956 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Nov 2021 10:53:17 +0100 Subject: [PATCH 5/9] fix(osx): deprecate `osx` plugin without symlink (#10428) Fixes #10428 --- plugins/macos/macos.plugin.zsh | 6 ------ plugins/macos/osx.plugin.zsh | 1 - plugins/osx | 1 - plugins/osx/README.md | 3 +++ plugins/osx/osx.plugin.zsh | 5 +++++ 5 files changed, 8 insertions(+), 8 deletions(-) delete mode 120000 plugins/macos/osx.plugin.zsh delete mode 120000 plugins/osx create mode 100644 plugins/osx/README.md create mode 100644 plugins/osx/osx.plugin.zsh diff --git a/plugins/macos/macos.plugin.zsh b/plugins/macos/macos.plugin.zsh index 4bcbbaead..6a91be336 100644 --- a/plugins/macos/macos.plugin.zsh +++ b/plugins/macos/macos.plugin.zsh @@ -1,9 +1,3 @@ -# Check if 'osx' is still in the plugins list and prompt to change to 'macos' -if [[ -n "${plugins[(r)osx]}" ]]; then - print ${(%):-"%F{yellow}The \`osx\` plugin is deprecated and has been renamed to \`macos\`."} - print ${(%):-"Please update your .zshrc to use the \`%Bmacos%b\` plugin instead.%f"} -fi - # Open the current directory in a Finder window alias ofd='open_command $PWD' diff --git a/plugins/macos/osx.plugin.zsh b/plugins/macos/osx.plugin.zsh deleted file mode 120000 index 73d718d43..000000000 --- a/plugins/macos/osx.plugin.zsh +++ /dev/null @@ -1 +0,0 @@ -macos.plugin.zsh \ No newline at end of file diff --git a/plugins/osx b/plugins/osx deleted file mode 120000 index a8d0f9c48..000000000 --- a/plugins/osx +++ /dev/null @@ -1 +0,0 @@ -macos \ No newline at end of file diff --git a/plugins/osx/README.md b/plugins/osx/README.md new file mode 100644 index 000000000..98d859545 --- /dev/null +++ b/plugins/osx/README.md @@ -0,0 +1,3 @@ +# osx plugin + +**Deprecated: use the [`macos`](https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/macos) plugin instead.** diff --git a/plugins/osx/osx.plugin.zsh b/plugins/osx/osx.plugin.zsh new file mode 100644 index 000000000..9304e7f32 --- /dev/null +++ b/plugins/osx/osx.plugin.zsh @@ -0,0 +1,5 @@ +print ${(%):-'%F{yellow}The `osx` plugin is deprecated and has been renamed to `macos`.'} +print ${(%):-'Please update your .zshrc to use the `%Bmacos%b` plugin instead.%f'} + +(( ${fpath[(Ie)$ZSH/plugins/macos]} )) || fpath=("$ZSH/plugins/macos" $fpath) +source "$ZSH/plugins/macos/macos.plugin.zsh" From 88e72e8a5482db677a1d07722293a3a4f8f71342 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Nov 2021 10:35:32 +0100 Subject: [PATCH 6/9] fix(docker-compose)!: check for old command instead of calling `docker` (#10409) BREAKING CHANGE: the plugin now checks for the `docker-compose` command instead of trying whether `docker compose` is a valid command. This means that if the old command is still installed it will be used instead. To use `docker compose`, uninstall any old copies of `docker-compose`. Fixes #10409 --- plugins/docker-compose/docker-compose.plugin.zsh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/docker-compose/docker-compose.plugin.zsh b/plugins/docker-compose/docker-compose.plugin.zsh index 13985fc82..b8a4b067d 100644 --- a/plugins/docker-compose/docker-compose.plugin.zsh +++ b/plugins/docker-compose/docker-compose.plugin.zsh @@ -1,7 +1,5 @@ # support Compose v2 as docker CLI plugin -DOCKER_CONTEXT=default command docker compose &>/dev/null \ - && dccmd='docker compose' \ - || dccmd='docker-compose' +(( ${+commands[docker-compose]} )) && dccmd='docker-compose' || dccmd='docker compose' alias dco="$dccmd" alias dcb="$dccmd build" From ff09151d6b82fef7af4ced774a416a36e7835b8a Mon Sep 17 00:00:00 2001 From: Aurora Date: Wed, 17 Nov 2021 11:44:04 +0100 Subject: [PATCH 7/9] fix(bgnotify): avoid permission prompts by checking frontmost app ID (#10318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc Cornellà --- plugins/bgnotify/bgnotify.plugin.zsh | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/plugins/bgnotify/bgnotify.plugin.zsh b/plugins/bgnotify/bgnotify.plugin.zsh index aecde20ea..479796dbe 100644 --- a/plugins/bgnotify/bgnotify.plugin.zsh +++ b/plugins/bgnotify/bgnotify.plugin.zsh @@ -20,6 +20,12 @@ if ! (type bgnotify_formatted | grep -q 'function'); then ## allow custom functi } fi +currentAppId () { + if (( $+commands[osascript] )); then + osascript -e 'tell application (path to frontmost application as text) to id' 2>/dev/null + fi +} + currentWindowId () { if hash osascript 2>/dev/null; then #osx osascript -e 'tell application (path to frontmost application as text) to id of front window' 2&> /dev/null || echo "0" @@ -32,11 +38,20 @@ currentWindowId () { bgnotify () { ## args: (title, subtitle) if hash terminal-notifier 2>/dev/null; then #osx - [[ "$TERM_PROGRAM" == 'iTerm.app' ]] && term_id='com.googlecode.iterm2'; - [[ "$TERM_PROGRAM" == 'Apple_Terminal' ]] && term_id='com.apple.terminal'; + local term_id="$bgnotify_appid" + if [[ -z "$term_id" ]]; then + case "$TERM_PROGRAM" in + iTerm.app) term_id='com.googlecode.iterm2' ;; + Apple_Terminal) term_id='com.apple.terminal' ;; + esac + fi + ## now call terminal-notifier, (hopefully with $term_id!) - [ -z "$term_id" ] && terminal-notifier -message "$2" -title "$1" >/dev/null || - terminal-notifier -message "$2" -title "$1" -activate "$term_id" -sender "$term_id" >/dev/null + if [[ -z "$term_id" ]]; then + terminal-notifier -message "$2" -title "$1" >/dev/null + else + terminal-notifier -message "$2" -title "$1" -activate "$term_id" -sender "$term_id" >/dev/null + fi elif hash growlnotify 2>/dev/null; then #osx growl growlnotify -m "$1" "$2" elif hash notify-send 2>/dev/null; then #ubuntu gnome! @@ -54,6 +69,7 @@ bgnotify () { ## args: (title, subtitle) bgnotify_begin() { bgnotify_timestamp=$EPOCHSECONDS bgnotify_lastcmd="${1:-$2}" + bgnotify_appid="$(currentAppId)" bgnotify_windowid=$(currentWindowId) } @@ -62,7 +78,7 @@ bgnotify_end() { elapsed=$(( EPOCHSECONDS - bgnotify_timestamp )) past_threshold=$(( elapsed >= bgnotify_threshold )) if (( bgnotify_timestamp > 0 )) && (( past_threshold )); then - if [ $(currentWindowId) != "$bgnotify_windowid" ]; then + if [[ $(currentAppId) != "$bgnotify_appid" || $(currentWindowId) != "$bgnotify_windowid" ]]; then print -n "\a" bgnotify_formatted "$didexit" "$bgnotify_lastcmd" "$elapsed" fi From 98b48015486bc638ba8f989af9285b73c413f9e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Wed, 17 Nov 2021 12:35:23 +0100 Subject: [PATCH 8/9] fix(bundler): use BUNDLE_JOBS in `bi` to avoid config file change When calling `bundle install` with `--jobs=`, bundle persists this argument in `.bundle/config`. If we run `BUNDLE_JOBS= bundle install` instead, this is not persisted. Fixes #10425 --- plugins/bundler/bundler.plugin.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index 6293dc28a..c93d4869e 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -40,7 +40,7 @@ bundle_install() { else local cores_num="$(nproc)" fi - bundle install --jobs="$cores_num" "$@" + BUNDLE_JOBS="$cores_num" bundle install "$@" } ## Gem wrapper From 15fd9c84deae400ba52451d75548fb8f6ec26bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Cornell=C3=A0?= Date: Tue, 9 Nov 2021 15:07:09 +0100 Subject: [PATCH 9/9] style(bundler): simplify `bundled_commands` array operations --- plugins/bundler/bundler.plugin.zsh | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh index c93d4869e..c1cbb13dd 100644 --- a/plugins/bundler/bundler.plugin.zsh +++ b/plugins/bundler/bundler.plugin.zsh @@ -81,14 +81,12 @@ bundled_commands=( ) # Remove $UNBUNDLED_COMMANDS from the bundled_commands list -for cmd in $UNBUNDLED_COMMANDS; do - bundled_commands=(${bundled_commands#$cmd}); -done +bundled_commands=(${bundled_commands:|UNBUNDLED_COMMANDS}) +unset UNBUNDLED_COMMANDS # Add $BUNDLED_COMMANDS to the bundled_commands list -for cmd in $BUNDLED_COMMANDS; do - bundled_commands+=($cmd); -done +bundled_commands+=($BUNDLED_COMMANDS) +unset BUNDLED_COMMANDS # Check if in the root or a subdirectory of a bundled project _within-bundled-project() { @@ -126,5 +124,4 @@ for cmd in $bundled_commands; do compdef "_$cmd" "bundled_$cmd"="$cmd" fi done - unset cmd bundled_commands