zsh-workers
 help / color / mirror / code / Atom feed
* Unexpected behavior for completion funcion _remote_files()
@ 2016-09-06 14:34 Yoshio Hanawa
  2016-09-06 15:55 ` Oliver Kiddle
  0 siblings, 1 reply; 7+ messages in thread
From: Yoshio Hanawa @ 2016-09-06 14:34 UTC (permalink / raw)
  To: zsh-workers

[-- 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-11-03 21:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-06 14:34 Unexpected behavior for completion funcion _remote_files() Yoshio Hanawa
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

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).