Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Unexpected behavior for completion funcion _remote_files()



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


Messages sorted by: Reverse Date, Date, Thread, Author