zsh-workers
 help / color / mirror / code / Atom feed
From: Yoshio Hanawa <y@hnw.jp>
To: zsh-workers@zsh.org
Subject: Unexpected behavior for completion funcion _remote_files()
Date: Tue, 6 Sep 2016 23:34:47 +0900	[thread overview]
Message-ID: <CA+JhjB_Ry--Va9-Vz4z_6V7iEeEpJ2UbdAsFJFPe7vYcknB60A@mail.gmail.com> (raw)

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

Hello all,

When I tried Zsh completion funcion _remote_files with 'docker exec ...', I
found the command line options for _remote_files (in this case, 'exec ...')
are passed directly to compadd. I think it's unexpected behavior.


--- Completion/Unix/Type/_remote_file:75-78
***
      [[ -n $suf ]] &&
          compadd "$@" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0
      compadd ${suf:+-S/} -r "/ \t\n\-" "$@" "$expl[@]" -d remdispd \
${(q)remdispd%/} && ret=0
***


"$@" in compadd arguments seems to be unnecessary, so should simply be
removed.

The following patch works fine on my environment.


*** zsh-5.2-orig/Completion/Unix/Type/_remote_files 2016-09-06
22:55:25.000000000 +0900
--- zsh-5.2/Completion/Unix/Type/_remote_files 2016-09-06
22:56:12.000000000 +0900
***************
*** 74,81 ****
    while _tags; do
      while _next_label files expl ${suf:-remote directory}; do
        [[ -n $suf ]] &&
!           compadd "$@" "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} &&
ret=0
!       compadd ${suf:+-S/} -r "/ \t\n\-" "$@" "$expl[@]" -d remdispd \
  ${(q)remdispd%/} && ret=0
      done
      (( ret )) || return 0
--- 74,81 ----
    while _tags; do
      while _next_label files expl ${suf:-remote directory}; do
        [[ -n $suf ]] &&
!           compadd "$expl[@]" -d remdispf ${(q)remdispf%[*=|]} && ret=0
!       compadd ${suf:+-S/} -r "/ \t\n\-" "$expl[@]" -d remdispd \
  ${(q)remdispd%/} && ret=0
      done
      (( ret )) || return 0

             reply	other threads:[~2016-09-06 14:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 14:34 Yoshio Hanawa [this message]
2016-09-06 15:55 ` Oliver Kiddle
2016-09-06 17:26   ` Yoshio Hanawa
2016-09-06 22:16   ` Daniel Shahaf
2016-09-12 15:30     ` Oliver Kiddle
2016-11-03 14:59       ` Daniel Shahaf
2016-11-03 15:37         ` Bart Schaefer

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=CA+JhjB_Ry--Va9-Vz4z_6V7iEeEpJ2UbdAsFJFPe7vYcknB60A@mail.gmail.com \
    --to=y@hnw.jp \
    --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).