On Wed, Dec 30, 2020 at 5:04 PM Felipe Contreras wrote: > > With that I do see the output. There's some garbage in it, but it works. I'm curious what the garbage is? Maybe something needs redirection. Attached (to prevent gmail line wrapping) is a still-fragmentary and undocumented source-able implementation. * It works better to discard compstate[vared] than to muck with _comps[-vared-] * Uses a restricted keymap to avoid messing with the main keymap. * Some names "protected" with double-underscore as in zed. * Included a debug function although it's a bit knobbly. At an interactive command-line, you can type e.g. run-complete git -- to see what the completion might be. I wonder about attaching this to something ala run-help. However, that doesn't work if output is redirected anywhere. If you want to pipe it or put it in a command substitution, you have to use e.g. complete git -- | less or guesses=( $(complete git --) ) Also, each word has to be individually quoted, you won't get useful results from complete "git --"