completion for tmux (2019-10-23 21:27 by nereusx #83733)
Hello, I am new yash user. I like it so much that I did it login shell.
IMHO Thompson's syntax sucks, so I used tcsh for decades.
All known shell implementations with exception rc/es are sucks too, but yash at least is pretty well written. Nice job guys.
I am try to build completion for tmux. The documentation of 'complete' it is not so good yet.
So, I read a few scripts of /usr/share/yash/completion, to figure out how to do it.
This is what I succeed to do, it is not the best solution but do the basic job.
Could you help?
---
function completion/tmux {
typeset words option desc i IFS='
'
while read -A words; do
desc=${words[2,-1]}
for option in "${words[1,1]%,}"; do
complete -D "$desc" -- "${option}"
done
done <("${WORDS[1]}" list-commands 2>&1)
}
---