From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 455 invoked from network); 1 Apr 2020 22:54:14 -0000 Received-SPF: pass (primenet.com.au: domain of zsh.org designates 203.24.36.2 as permitted sender) receiver=inbox.vuxu.org; client-ip=203.24.36.2 envelope-from= Received: from ns1.primenet.com.au (HELO primenet.com.au) (203.24.36.2) by inbox.vuxu.org with UTF8ESMTPZ; 1 Apr 2020 22:54:14 -0000 Received: (qmail 26390 invoked by alias); 1 Apr 2020 22:54:08 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45655 Received: (qmail 14450 invoked by uid 1010); 1 Apr 2020 22:54:08 -0000 X-Qmail-Scanner-Diagnostics: from mail-qk1-f177.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.2/25765. spamassassin: 3.4.2. Clear:RC:0(209.85.222.177):SA:0(-1.9/5.0):. Processed in 4.143076 secs); 01 Apr 2020 22:54:08 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.222.177 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=Bfjwq8zVXbLtsQkd/EyLJhxTusUNgUvfHH1ag8Y4zno=; b=lmOB5/cV/mYjipZ/faZqUw3vTR15MTd9wC+rV5MIspJvgcXSNqA2N0e0L0LdKEU60K PquLZnPh6sTU5gWqIYImF71mBXTFj/I5y8JLCFS5kQJYF6mgdqhMH3HQl7qcLwebzSYy AVBa3TSxy5iono+NBKGOW1MkYn3Y5e/OM1zoH4Y+A+kpKQ8nlMxIydl76PHhij8rwbLr UlWvkQBi+0ry3q+yvkMAF8HmLDy6C4WFmO9AA1HVOrvJhOwQo7hxj8VAl8iK69qnU8Ub YCCqkFEF2C7XnCfBlQnhQDs0kWRycFk+ipF9HKrcfiRVsc2OiOSMYRWEVI1DZBzThE4U 5fEQ== X-Gm-Message-State: AGi0PuYnTCXT3Tngg2W5VAXEj2LYz4cByTxJAAw+rTNEjZ8kjiF1hqiS xE6kdRZ0m4XjDagIYmg2ynuO1znZzGw1sg== X-Google-Smtp-Source: APiQypKosYu+IdXxA1ZkUQ0oa//lR87GutDAJSW89oqjhDKwShnfLWaif6viXb2vWoVyp91U5IIW2g== X-Received: by 2002:ae9:efc8:: with SMTP id d191mr627320qkg.1.1585781610907; Wed, 01 Apr 2020 15:53:30 -0700 (PDT) From: dana Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: [PATCH] Update _retrieve_mac_apps for recent macOS Message-Id: <0427896C-0EA7-4BD0-9605-E69F35055F09@dana.is> Date: Wed, 1 Apr 2020 17:53:29 -0500 To: Zsh hackers list X-Mailer: Apple Mail (2.3608.60.0.2.5) I noticed that completion for e.g. `open -a` doesn't show stuff like = QuickTime Player on Catalina. That's because most of the built-in apps now live = under /System/Applications (Finder just merges everything together when it = displays /Applications) But it should have been using Spotlight anyway =E2=80=94 it wasn't = because the way we check to see if the root volume is indexed doesn't work any more, and = hasn't worked for a long time i think This fixes both problems PS: I didn't address workers/45418 here, but i still plan to dana 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 )" =3D=3D *enabled* ]]; then # / is indexed to use Spotlight retrieve=3D_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 =3D _mac_apps_old_retrieve ]]; then - app_dir_root=3D( = {,/Developer,/Network,"$HOME"}/{Applications*(N),Desktop} ) + app_dir_root=3D( + = {,/Developer,/Network,/System,$HOME}/{Applications*(N),Desktop} + ) + app_dir_root=3D( $^app_dir_root(N) ) else app_dir_root=3D( / ) fi