jaredmichaelwilliams / zsh-templates-osx

Automatically exported from code.google.com/p/zsh-templates-osx
GNU General Public License v2.0
2 stars 0 forks source link

open -a completion fails on leopard w/ spotlight disabled #2

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. disable spotlight on a drive (using, say this method:
http://www.macosxhints.com/comment.php?mode=view&cid=93904)
2. attempt to use open -a tab completion

What is the expected output? What do you see instead?
Completion doesn't work without spotlight enabled.  It should fall back
gracefully onto pre-tiger method.  I think this should work in most cases.

It would probably be better to check which mount /Applications &
~/Applications belonged to and then do the checks on those rather than just
at the root drive.

--- a/zsh/local-functions/darwin/_open
+++ b/zsh/local-functions/darwin/_open
@@ -33,7 +33,7 @@ _open() {

   case "$state" in
     open_mac_applications)
-      if [[ $OSTYPE[7] -ge '8' ]]; then
+      if [[ $OSTYPE[7] -ge '8' && ! (`mdutil -s / | awk '/nabled/'` == '')
]]; then
         _init_open_tiger
         _alternative \
             "commands: :_mac_applications" \

Original issue reported on code.google.com by jbsny...@gmail.com on 27 Apr 2008 at 12:30

GoogleCodeExporter commented 8 years ago
Thanks.  I should have allowed for this possibility.

Original comment by wgsco...@mac.com on 15 Sep 2008 at 5:06

GoogleCodeExporter commented 8 years ago
should be fixed in rev60

Original comment by wgsco...@mac.com on 15 Sep 2008 at 5:40