Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: completion fails if dir referenced via variable.

On 02/26/2014 06:29 PM, Bart Schaefer wrote:

Thanks Bart, I'm not sophisticated enough yet for this sort of thing. Where do I put this function? I'll certainly play with it, but I've not yet looked into the guts of any of this stuff. All those 'zstyle' things are a mystery. Is there some recommended doc? It's time I knew what those dozen or so 'zstyle' lines did.

As to:

} BTW another strange thing: if I start a fresh shell, I can't expand a
} variable unless I 'echo' it first. The variable is certainly set, and it
} echos to screen, but without echoing it, it will not expand nohow. Any
} reason of that?

I'm guessing this is going to depend on which variable you're trying.
Some variables are autoloaded from modules and appear when you reference
them with $varname, but wouldn't be around yet to be completed when you
first attempt it.

The variable is $t[?] where '?' is the number of each open terminal, and which holds the current directory for each open terminal. It's updated automatically within 'chpwd()'. So 'cp $t1/filename .' copies 'filename' from whatever is the current directory on terminal #1 to the current directory on whatever terminal the command is executed from. It works fine except that it won't expand on the command line in a brand new shell. Note this is not much of an issue since there's no problem with the actual copy, only with expanding it visually with TAB, and that only becomes an issue if I'm wanting to complete a filename in the same command in which a variable also exists, so it's the most minimal of bugs. Still it seems to me that it should expand. Actually, any command at all prior to the command in which I attempt this sort of expansion solves the problem so it's only happens with an absolutely virgin shell. Not worth any trouble.

Messages sorted by: Reverse Date, Date, Thread, Author