From: dana <dana@dana.is>
To: Philippe Troin <phil@fifi.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: A cute bug involving aliases and _remote_files
Date: Tue, 26 Feb 2019 03:23:04 -0600 [thread overview]
Message-ID: <3D38E0FC-DE43-4CFD-86E2-B258D9DA816C@dana.is> (raw)
In-Reply-To: <0d066d726a76a85461089339e25e207663d389b7.camel@fifi.org>
On 25 Feb 2019, at 20:49, Philippe Troin <phil@fifi.org> wrote:
>Would it make sense to use "command ls" instead of "ls" for remote
>directory listings in _remote_files? That would make sure that no
>aliases nor functions are involved.
That *seems* reasonable...?
Now that you mention it, GNU ls changed its default quoting behaviour somewhat
recently. I think it only quotes when (a) QUOTING_STYLE is set, (b) one of the
quoting options is given on the command line, or (c) the output is a TTY — so
it's unlikely to be an issue for _remote_files, given how it's normally used.
But maybe it'd be a good idea to force it off anyway, just in case?
dana
diff --git a/Completion/Unix/Type/_remote_files b/Completion/Unix/Type/_remote_files
index 267715a51..89cf102cf 100644
--- a/Completion/Unix/Type/_remote_files
+++ b/Completion/Unix/Type/_remote_files
@@ -59,7 +59,10 @@ if zstyle -T ":completion:${curcontext}:files" remote-access; then
fi
# remote filenames
- remfiles=(${(M)${(f)"$(_call_program files $cmd $cmd_args $host ls -d1FL -- "$rempat" 2>/dev/null)"}%%[^/]#(|/)})
+ remfiles=(${(M)${(f)"$(
+ _call_program files $cmd $cmd_args $host \
+ QUOTING_STYLE=literal command ls -d1FL -- "$rempat" 2>/dev/null
+ )"}%%[^/]#(|/)})
compset -P '*/'
compset -S '/*' || (( ${args[(I)-/]} )) || suf='remote file'
next prev parent reply other threads:[~2019-02-26 9:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 2:49 Philippe Troin
2019-02-26 9:23 ` dana [this message]
2019-02-26 9:40 ` Peter Stephenson
2019-02-27 8:27 ` Philippe Troin
2019-02-27 8:42 ` dana
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=3D38E0FC-DE43-4CFD-86E2-B258D9DA816C@dana.is \
--to=dana@dana.is \
--cc=phil@fifi.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).