zsh-users
 help / color / mirror / code / Atom feed
* Zsh not completing redirection anymore
@ 2014-01-08  5:31 Sohron Viholainen
  2014-01-08  7:30 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sohron Viholainen @ 2014-01-08  5:31 UTC (permalink / raw)
  To: zsh-users

Hello all,

This is my ~/.zshrc: http://pastebin.com/YY6iLXxM (remaining at pastebin for a month)

I’m using zsh-templates-osx (https://code.google.com/p/zsh-templates-osx/) with vi- and zshall keybindings, but haven’t changed anything in it lately. For some reason redirection like, say `echo foo > file<TAB>’ or `echo foo >> file<TAB>’ doesn’t complete to file.txt or anything existing with string “file” in the beginning for that matter anymore. This occurs with every file of course, not just with string “file” in the beginning. Completion doesn’t work with < either.

I have fiddled with my ~/.zshrc at some point, but I can’t for the life of me remember what I did to make redirection completion dysfunctional and I realised the fact only later on. And even though I have used Zsh for a long time I still don’t understand everything about the configuration… And, of course I made the modification before I realised to put my dot files in to git :(

Hope someone can help me, as naturally redirection completion is quite often used…

-- 
Marko Vihoma
http://personal.inet.fi/koti/marko.vihoma/


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Zsh not completing redirection anymore
  2014-01-08  5:31 Zsh not completing redirection anymore Sohron Viholainen
@ 2014-01-08  7:30 ` Bart Schaefer
  2014-01-08  8:56   ` Sohron Viholainen
  0 siblings, 1 reply; 4+ messages in thread
From: Bart Schaefer @ 2014-01-08  7:30 UTC (permalink / raw)
  To: Zsh Users

On Tue, Jan 7, 2014 at 9:31 PM, Sohron Viholainen <lokki1977@gmail.com> wrote:
>
> I’m using zsh-templates-osx (https://code.google.com/p/zsh-templates-osx/) with vi- and zshall keybindings, but haven’t changed anything in it lately.

Nevertheless I think this must be where the problem lies.  I'm not
going to pretend to have time or interest in poring over that, but I
don't find anything in your pastebin'd .zshrc that is the culprit.

> For some reason redirection like, say `echo foo > file<TAB>’ or `echo foo >> file<TAB>’ doesn’t complete to file.txt or anything existing

Use <ctrl+x h> and <ctrl+x ?> (_complete_help and _complete_debug) to
see if anything looks odd.  <ctrl+x h> should give you something very
much like:

tags in context :completion::complete:-redirect-,>,echo::
    all-files  (_files _redirect)

Output from <ctrl+x ?> goes to a file and can be difficult to
interpret.  If completion after just "echo" (without redirection) is
still working, capture one debug file that way and a second one with
the redirect so the two can be compared.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Zsh not completing redirection anymore
  2014-01-08  7:30 ` Bart Schaefer
@ 2014-01-08  8:56   ` Sohron Viholainen
  2014-01-09  1:19     ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Sohron Viholainen @ 2014-01-08  8:56 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 2850 bytes --]

Thank you :)

after disabling\x10 \x10~/.zsh/zshrc.d/121_environment.completions.additional.zsh redirection worked right. I looked inside the file and decided to comment out this part in the beginning of the file, as app completion has never worked after all:
----BEGIN----

    #######################################################
    ####  Make the "open -a" completion work faster  ######
    #######################################################

    # This is to make the "open -a" command completion snappier.
    # touching the file upon shell startup will trigger various launchd items
    # that in turn will ensure completions are up to date.  We run the command once 
    # now to establish a short-term SpotLight cache.

    if [[ -f /Library/LaunchAgents/zsh.refresh.completion.plist  || \
              -f /Library/LaunchAgents/zsh.refresh.completion.plist  ]];then
                        touch ~/.zsh/zrefresh 2>/dev/null
                        chmod 777 ~/.zsh/zrefresh  2>/dev/null
        fi
    
        # This seems to work better:
    
        if [[ -x /usr/bin/mdfind ]];then
            ( mdfind -onlyin /Applications -onlyin /Developer \
    \x10\x10        "kMDItemContentType == 'com.apple.application-*'" >| \
            /dev/null 2>&1 & ; );
        fi
----END----

I don’t really see what’s wrong with the above, but commenting it out and then re-enabling the file fixed my problem and now even the `open -a <TAB>’ works just fine and fast, so ~/.zsh/cache/<hostname>/Mac_applications got filled quickly and completely :D

On 08 Jan 2014, at 09:30, Bart Schaefer <schaefer@brasslantern.com> wrote:

> On Tue, Jan 7, 2014 at 9:31 PM, Sohron Viholainen <lokki1977@gmail.com> wrote:
>> 
>> I’m using zsh-templates-osx (https://code.google.com/p/zsh-templates-osx/) with vi- and zshall keybindings, but haven’t changed anything in it lately.
> 
> Nevertheless I think this must be where the problem lies.  I'm not
> going to pretend to have time or interest in poring over that, but I
> don't find anything in your pastebin'd .zshrc that is the culprit.
> 
>> For some reason redirection like, say `echo foo > file<TAB>’ or `echo foo >> file<TAB>’ doesn’t complete to file.txt or anything existing
> 
> Use <ctrl+x h> and <ctrl+x ?> (_complete_help and _complete_debug) to
> see if anything looks odd.  <ctrl+x h> should give you something very
> much like:
> 
> tags in context :completion::complete:-redirect-,>,echo::
>    all-files  (_files _redirect)
> 
> Output from <ctrl+x ?> goes to a file and can be difficult to
> interpret.  If completion after just "echo" (without redirection) is
> still working, capture one debug file that way and a second one with
> the redirect so the two can be compared.

-- 
Marko Vihoma
http://personal.inet.fi/koti/marko.vihoma/


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Zsh not completing redirection anymore
  2014-01-08  8:56   ` Sohron Viholainen
@ 2014-01-09  1:19     ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2014-01-09  1:19 UTC (permalink / raw)
  To: Zsh Users

On Wed, Jan 8, 2014 at 12:56 AM, Sohron Viholainen <lokki1977@gmail.com> wrote:
> Thank you :)
>
> after disabling   ~/.zsh/zshrc.d/121_environment.completions.additional.zsh redirection worked right. I looked inside the file and decided to comment out this part in the beginning of the file, as app completion has never worked after all:
> ----BEGIN----
>
>     #######################################################
>     ####  Make the "open -a" completion work faster  ######
>     #######################################################
>
>     # This is to make the "open -a" command completion snappier.
>     # touching the file upon shell startup will trigger various launchd items
>     # that in turn will ensure completions are up to date.  We run the command once
>     # now to establish a short-term SpotLight cache.
>
>     if [[ -f /Library/LaunchAgents/zsh.refresh.completion.plist  || \
>               -f /Library/LaunchAgents/zsh.refresh.completion.plist  ]];then


??  That's pretty strange on the face of it.  Why is it doing exactly
the same test on the same file twice in the same [[ ]] expression?

>                         touch ~/.zsh/zrefresh 2>/dev/null
>                         chmod 777 ~/.zsh/zrefresh  2>/dev/null

I don't see a reference to this zrefresh file anywhere else in *this*
file (looked up on the git repository), so I suspect the real problem
is going to occur somewhere later in the process where the
timestamp/existence of the zrefresh file is examined.

>         fi
>
>         # This seems to work better:
>
>         if [[ -x /usr/bin/mdfind ]];then
>             ( mdfind -onlyin /Applications -onlyin /Developer \
>               "kMDItemContentType == 'com.apple.application-*'" >| \
>             /dev/null 2>&1 & ; );
>         fi

This part had better be irrelevant, it doesn't do anything (all output
thrown away) except allow Spotlight to load its internal caches.

What might be interesting is to see a diff of _complete_debug output
in the broken case and the working case, that might show what the
effect of the zrefresh file is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-01-09  1:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-08  5:31 Zsh not completing redirection anymore Sohron Viholainen
2014-01-08  7:30 ` Bart Schaefer
2014-01-08  8:56   ` Sohron Viholainen
2014-01-09  1:19     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).