From: Philippe Troin <phil@fifi.org>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: A cute bug involving aliases and _remote_files
Date: Mon, 25 Feb 2019 18:49:23 -0800 [thread overview]
Message-ID: <0d066d726a76a85461089339e25e207663d389b7.camel@fifi.org> (raw)
Hi,
I have the following aliases in my .zshenv:
alias ls='command ls -Fbv'
The interesting part there is the "-b" which instructs ls to quote
unprintable characters and spaces.
But in _remote_files we do:
_call_program files $cmd $cmd_args $host ls -d1FL --
which will use the alias, and when I complete a file with a space, zsh
ends up prefixing the space with 7 backslashes, as there's now an extra
round of escaping performed.
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.
I don't need any downsides as all shells that I'm aware of have the
"command" pre-command modifier.
Example of the issue (you need to alias ls as described above for this
to show):
% mkdir test_dir
% touch test_dir/'a file'
% scp localhost:$PWD/test_dir/a
^ Press TAB
===> completes to:
% scp localhost:$PWD/test_dir/a\\\\\\\ file
I have this in my .zshrc in the meantime:
_remote_files() {
unfunction _remote_files
autoload +X _remote_files
if [[ $functions[_remote_files] != *' command ls -' ]]
then
functions[_remote_files]=${functions[_remote_files]// ls -/ command ls -}
fi
_remote_files $*
}
Yet it would be neat if this were fixed upstream.
Thanks,
Phil.
next reply other threads:[~2019-02-26 2:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-26 2:49 Philippe Troin [this message]
2019-02-26 9:23 ` dana
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=0d066d726a76a85461089339e25e207663d389b7.camel@fifi.org \
--to=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).