petronny / pinyin-completion

complete path name based upon the pinyin acronym of Chinese characters
GNU General Public License v3.0
63 stars 13 forks source link

zsh extra qoute #17

Closed leoleoasd closed 8 months ago

leoleoasd commented 1 year ago

should replace

reply=(${(q)$(pinyin-comp x-d $*)} $*)

with

reply=(${$(pinyin-comp x-d $*)} $*)

to avoid outputs being escaped twice:

(base) (win/x64)  ➜  ~/winhome/Downloads ls zr<TAB>
\'自然语言处理结课报告封面.docx\'  \'自然语言处理课程结课作业.docx\'  zr
(base) (win/x64)  ➜  ~/winhome/Downloads ls \'自然语言处理结课报告封面.docx\' # should be '自然语言处理结课报告封面.docx'
Freed-Wu commented 8 months ago

${(q)...} is needed, because filenames can contains whitespace or other special characters which should be quoted.

image