zsh-workers
 help / color / mirror / code / Atom feed
From: Phil Pennock <zsh-workers+phil.pennock@spodhuis.org>
To: zsh-workers@zsh.org
Subject: Re: Literal `~` directory created?
Date: Thu, 18 May 2023 13:59:55 -0400	[thread overview]
Message-ID: <ZGZnm5Hv8ldicqBD@fullerene.field.pennock-tech.net> (raw)
In-Reply-To: <92F7C23E-37C1-4204-95E1-6B8050F9CAB0@gmail.com>

On 2023-05-18 at 13:50 -0400, Tom Vaughan wrote:
> Thanks, Phil. Based on this it seems like the problem is due to:
> 
>     mkdir -m 0700 -p "$_cache_dir"

> Tilde is not expanded when quoted, right? _cache_dir is set a little higher up at https://github.com/zsh-users/zsh/blob/master/Completion/Base/Utility/_store_cache#L10:
> 
>     $ echo $_cache_dir
> 
>     $ zstyle -s ":completion:${curcontext}:" cache-path _cache_dir
> 
>     $ echo $_cache_dir
>     ~/.cache/zsh/compcache
> 
> Perhaps this tilde should be expanded? Running the mkdir command above creates a literal '~' directory in the current working directory.

It should have been expanded _when you set the style_.

So don't quote a parameter when invoking zstyle to set it, because then
you're setting the style's value to hold the literal string.

You should have things like:

    zstyle ':completion:*' urls ~/.urls
    zstyle ':completion:*' cache-path ~/.cache/zsh/${HOST%%.*}

-Phil


  reply	other threads:[~2023-05-18 18:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 13:59 thomas.david.vaughan
2023-05-18 16:52 ` Phil Pennock
2023-05-18 17:50   ` Tom Vaughan
2023-05-18 17:59     ` Phil Pennock [this message]
2023-05-18 18:48       ` Tom Vaughan
2023-05-18 21:37         ` Phil Pennock
2023-05-18 22:25           ` Tom Vaughan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZGZnm5Hv8ldicqBD@fullerene.field.pennock-tech.net \
    --to=zsh-workers+phil.pennock@spodhuis.org \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).