This message was deleted.
# how-do-i
s
This message was deleted.
d
what happens with
which _gt_yargs_completions
?
command not found? or prints the function?
i literally pasted this into
zshrc
& restarted the shell:
Copy code
_gt_yargs_completions()
{
  local reply
  local si=$IFS
  IFS=$'
' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" gt --get-yargs-completions "${words[@]}"))
  IFS=$si
  _describe 'values' reply
}
compdef _gt_yargs_completions gt
and completion is working
are you 100% sure you're in a shell with the latest zshrc?
i'll try the eval way next
this is not working:
Copy code
eval "$(gt completion)"
v
hmm, pasting your thing worked. I did paste `gt completion`'s output into my zshrc and restart shell, but I must be doing something wrong
will dig further
d
hm
the output says to do this:
Copy code
# yargs command completion script
#
# Installation: gt completion >> ~/.zshrc
#    or gt completion >> ~/.zprofile on OSX.
aka dump it straight into zshrc
v
yup I did try that
d
do we have docs that tell you otherwise?
ok what the heck
Copy code
gt completion >> ~/.zshrc
this doesn't work even though it should be the same as pasting
i'm going to convert this down to the function + compdef line
that didn't work either
now none of the methods work??
v
ok, it works for me now. (1) pasting in shell works (2) putting it in my shell config didn't work initially because something that is included/defined after it broke it, explicitly making it the last thing does work. so now I'll try to figure out what is breaking it
if i figure that out i'd guess the
eval
will also work
d
it's pretty curious
i was reloading the shell with
exec zsh
v
ok, final conclusions: 1. I had a stray
compinit -i
after this completion script, so it broke something. getting rid of that fixed my ordering issue 2.
eval $(gt completion)
does not work for me, not enough of a shell expert to understand why thanks for your help!
d
is it possible you need to quote it, like
Copy code
eval "$(starship init zsh)"
i'd be wary of no quotes
v
oh awesome! yes that makes sense and does work
a little knowledge is dangerous...