From cc3b6e092ec78c3da21e89b3885eec73a526e765 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Mon, 1 Apr 2024 23:33:48 -0400 Subject: [PATCH 01/10] Allow .dir_colors to be a symlink --- modules/utility/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/utility/init.zsh b/modules/utility/init.zsh index e10c4fe..5b4bf80 100644 --- a/modules/utility/init.zsh +++ b/modules/utility/init.zsh @@ -88,7 +88,7 @@ if [[ ${(@M)${(f)"$(ls --version 2>&1)"}:#*(GNU|lsd) *} ]]; then if (( ! $+LS_COLORS )); then # Try dircolors when available if is-callable 'dircolors'; then - eval "$(dircolors --sh $HOME/.dir_colors(.N))" + eval "$(dircolors --sh $HOME/.dir_colors(N))" else export LS_COLORS='di=34:ln=35:so=32:pi=33:ex=31:bd=36;01:cd=33;01:su=31;40;07:sg=36;40;07:tw=32;40;07:ow=33;40;07:' fi From 5ff938dff57a8f44a896a12260a73955fbec75e0 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Sun, 31 Mar 2024 15:38:21 -0400 Subject: [PATCH 02/10] Update Python virtualenvwrapper documentation --- modules/python/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/python/README.md b/modules/python/README.md index 2e3b2ee..821209a 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -13,7 +13,7 @@ disable _virtualenvwrapper_, add the following to _`${ZDOTDIR:-$HOME}/.zpreztorc`_. ```sh -zstyle ':prezto:module:python' skip-virtualenvwrapper-init 'on' +zstyle ':prezto:module:python:virtualenv' initialize 'no' ``` Conda support can be enabled by adding the following to From 185733aa63cae2ce0f2ff4bb914c2c16f7ed3502 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Sun, 31 Mar 2024 15:32:56 -0400 Subject: [PATCH 03/10] Update history-substring-search --- modules/history-substring-search/external | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/history-substring-search/external b/modules/history-substring-search/external index 400e58a..8dd05bf 160000 --- a/modules/history-substring-search/external +++ b/modules/history-substring-search/external @@ -1 +1 @@ -Subproject commit 400e58a87f72ecec14f783fbd29bc6be4ff1641c +Subproject commit 8dd05bfcc12b0cd1ee9ea64be725b3d9f713cf64 From 6bf4505b334d0d19a574789f279e91e4eacc285c Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Thu, 4 Apr 2024 00:42:17 -0400 Subject: [PATCH 04/10] Allow overriding _ssh_agent_sock for symmetry to _ssh_agent_env --- modules/ssh/init.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ssh/init.zsh b/modules/ssh/init.zsh index f870997..6bf237c 100644 --- a/modules/ssh/init.zsh +++ b/modules/ssh/init.zsh @@ -16,8 +16,8 @@ _ssh_dir="$HOME/.ssh" # Set the path to the environment file if not set by another module. _ssh_agent_env="${_ssh_agent_env:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.env}" -# Set the path to the persistent authentication socket. -_ssh_agent_sock="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock" +# Set the path to the persistent authentication socket if not set by another module. +_ssh_agent_sock="${_ssh_agent_sock:-${XDG_CACHE_HOME:-$HOME/.cache}/prezto/ssh-agent.sock}" # Start ssh-agent if not started. if [[ ! -S "$SSH_AUTH_SOCK" ]]; then From 085ab11646f375b312fe10fbcfddca9b14985d8d Mon Sep 17 00:00:00 2001 From: mattmc3 Date: Tue, 12 Dec 2023 11:59:16 -0500 Subject: [PATCH 05/10] osx: Add trash function --- modules/osx/functions/trash | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 modules/osx/functions/trash diff --git a/modules/osx/functions/trash b/modules/osx/functions/trash new file mode 100644 index 0000000..0efa215 --- /dev/null +++ b/modules/osx/functions/trash @@ -0,0 +1,31 @@ +# +# Moves files to the macOS trash. +# + +# function trash { + +emulate -L zsh +setopt LOCAL_OPTIONS EXTENDED_GLOB + +local file +local -a files=() +for file in $@; do + if [[ -e $file ]]; then + # ':a' gets the full path (do not use ':A', which would resolve symlinks) + files+=("the POSIX file \"${file:a}\"") + else + print "trash: No such file or directory '$file'." >&2 + return 1 + fi +done + +if (( $#files == 0 )); then + print 'usage: trash ' >&2 + return 64 # Match rm's return code. +fi + +# Join file list with commas, and tell Finder to trash that list. +local file_list="${(pj., .)files}" +osascript 2>&1 > /dev/null -e "tell app \"Finder\" to move { "${file_list}" } to trash" + +# } From f055c5070c3cb7521d0660f578e595f9ea087e1d Mon Sep 17 00:00:00 2001 From: Preston Hunt Date: Wed, 6 Dec 2023 16:40:24 -0800 Subject: [PATCH 06/10] screen module: don't try to attach to dead screens Removes dead screens from the list of candidate screens. Fixes issue 1253, "screen:auto-start problem with dead screens". --- modules/screen/init.zsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/screen/init.zsh b/modules/screen/init.zsh index 4dea566..1a3908d 100644 --- a/modules/screen/init.zsh +++ b/modules/screen/init.zsh @@ -22,7 +22,7 @@ if [[ -z "$STY" && -z "$EMACS" && -z "$VIM" ]] && ( \ session="$( screen -list 2> /dev/null \ | sed '1d;$d' \ - | awk '{print $1}' \ + | awk '!/Dead/ {print $1}' \ | head -1)" if [[ -n "$session" ]]; then From a79c3b4943469393f76347dda5dc414b42e84588 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Fri, 5 Apr 2024 19:19:21 -0400 Subject: [PATCH 07/10] Remove Python module comment about completion Local completion definition has been removed --- modules/python/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/modules/python/README.md b/modules/python/README.md index 821209a..b7a3230 100644 --- a/modules/python/README.md +++ b/modules/python/README.md @@ -2,9 +2,6 @@ Enables local Python and local Python package installation. -This module must be loaded _before_ the _`completion`_ module so that the -provided completion definitions are loaded. - ## Settings This module supports virtual environments from conda and From 005709d1201a6ad2f8b01b0185623e6d192d6c44 Mon Sep 17 00:00:00 2001 From: Yutian Li Date: Fri, 5 Apr 2024 19:21:15 -0400 Subject: [PATCH 08/10] Cache brew shellenv results This could sometimes be slow (as with any external command execution) but the result should almost never change. --- modules/homebrew/init.zsh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index 7899258..a6fca81 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -21,7 +21,20 @@ fi # Load 'HOMEBREW_' prefixed variables only. Avoid loading 'PATH' related # variables as they are already handled in standard zsh configuration. if (( $+commands[brew] )); then - eval "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" + cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/brew-shellenv-cache.zsh" + if [[ "${commands[brew]}" -nt "$cache_file" \ + || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ + || ( ! -n ${cache_file}(#qNmw-1) ) ]]; then + # Rebuild cache if either + # 1. brew is newer than the cache file + # 2. .zpreztorc is newer than the cache file + # 3. cache file doesn't exist + # 4. cache file is older than a week + mkdir -p "${cache_file:h}" + echo "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" >! "${cache_file}" + fi + source "${cache_file}" + unset cache_file fi # From 775f14d0c383ddc06c086e1632a9b377a5d0950c Mon Sep 17 00:00:00 2001 From: Indrajit Raychaudhuri Date: Mon, 8 Apr 2024 20:37:23 -0500 Subject: [PATCH 09/10] homebrew: Simplify caching `brew shellenv` Avoid checking age of cache file and just test for its existence. While this is simpler, this also avoids depending on having `EXTENDED_GLOB` enabled. --- modules/homebrew/init.zsh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/modules/homebrew/init.zsh b/modules/homebrew/init.zsh index a6fca81..dd2b565 100644 --- a/modules/homebrew/init.zsh +++ b/modules/homebrew/init.zsh @@ -22,18 +22,15 @@ fi # variables as they are already handled in standard zsh configuration. if (( $+commands[brew] )); then cache_file="${XDG_CACHE_HOME:-$HOME/.cache}/prezto/brew-shellenv-cache.zsh" - if [[ "${commands[brew]}" -nt "$cache_file" \ + if [[ "$commands[brew]" -nt "$cache_file" \ || "${ZDOTDIR:-$HOME}/.zpreztorc" -nt "$cache_file" \ - || ( ! -n ${cache_file}(#qNmw-1) ) ]]; then - # Rebuild cache if either - # 1. brew is newer than the cache file - # 2. .zpreztorc is newer than the cache file - # 3. cache file doesn't exist - # 4. cache file is older than a week - mkdir -p "${cache_file:h}" - echo "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" >! "${cache_file}" + || ! -s "$cache_file" ]]; then + mkdir -p "$cache_file:h" + # Cache the result. + echo "${(@M)${(f)"$(brew shellenv 2> /dev/null)"}:#export HOMEBREW*}" >! "$cache_file" 2> /dev/null fi - source "${cache_file}" + + source "$cache_file" unset cache_file fi From f5a8cb456b74d4d71caf46037a356d2deee27b50 Mon Sep 17 00:00:00 2001 From: Jim Date: Mon, 15 Apr 2024 16:28:00 +0100 Subject: [PATCH 10/10] Removing fig from README.md Fig is sunsetting as per https://fig.io/blog/post/fig-is-sunsetting --- README.md | 8 -------- 1 file changed, 8 deletions(-) diff --git a/README.md b/README.md index ead6af6..40163fa 100644 --- a/README.md +++ b/README.md @@ -73,14 +73,6 @@ version is **4.3.11**. 05. Open a new Zsh terminal window or tab. -### [Fig](https://fig.io) - -Fig adds apps, shortcuts, and autocomplete to your existing terminal. - -Install `prezto` in just one click. - - - ### Troubleshooting If you are not able to find certain commands after switching to Prezto, modify