summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordana <dana@dana.is>2020-04-05 20:09:10 -0500
committerdana <dana@dana.is>2020-04-05 20:09:10 -0500
commitc70d73436331e24b379c39ab191c0f9e74cc47a2 (patch)
tree4b2bec4079025a23b02c24f34fb07c61bc0b18ab
parent05b15366f317a4b5c110e454642c097a3963874b (diff)
downloadzsh-c70d73436331e24b379c39ab191c0f9e74cc47a2.tar.gz
zsh-c70d73436331e24b379c39ab191c0f9e74cc47a2.zip
45655: _retrieve_mac_apps: Update for recent macOS
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Darwin/Type/_retrieve_mac_apps7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e60ad77b9..9ba79bf46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2020-04-05 dana <dana@dana.is>
+
+ * 45655: Completion/Darwin/Type/_retrieve_mac_apps: Update
+ search paths and Spotlight index check for recent macOS
+
2020-04-05 Daniel Shahaf <d.s@daniel.shahaf.name>
* 45656: Etc/BUGS: Document the -o emacs segfault bug.
diff --git a/Completion/Darwin/Type/_retrieve_mac_apps b/Completion/Darwin/Type/_retrieve_mac_apps
index f24d36c3c..655170d3a 100644
--- a/Completion/Darwin/Type/_retrieve_mac_apps
+++ b/Completion/Darwin/Type/_retrieve_mac_apps
@@ -73,7 +73,7 @@ _retrieve_mac_apps() {
typeset retrieve
if ! zstyle -s ":completion:*:*:${service}:commands" search-method retrieve
then
- if [[ -d /.Spotlight-V100 ]]; then
+ if [[ "$( command mdutil -s / 2>&1 )" == *enabled* ]]; then
# / is indexed to use Spotlight
retrieve=_mac_apps_spotlight_retrieve
else
@@ -88,7 +88,10 @@ _retrieve_mac_apps() {
if ! zstyle -a ":completion:${curcontext}:" application-path app_dir_root
then
if [[ $retrieve = _mac_apps_old_retrieve ]]; then
- app_dir_root=( {,/Developer,/Network,"$HOME"}/{Applications*(N),Desktop} )
+ app_dir_root=(
+ {,/Developer,/Network,/System,$HOME}/{Applications*(N),Desktop}
+ )
+ app_dir_root=( $^app_dir_root(N) )
else
app_dir_root=( / )
fi