testmycode / tmc-cli

Command line client for tmc
MIT License
68 stars 22 forks source link

Autocomplete script doesn't run #409

Open s11i-code opened 4 years ago

s11i-code commented 4 years ago

I just installed TMC to my MacBook (OSX Catalina 10.15.7) When I try to source theTMC autocomplete (which is the line TMC adds to .zshrc ), this happens. I also to ran the tmc command to show it's in the $PATH, so I guess it's the 'tmc complete' that's the issue.

 % source ~/.tmc-autocomplete.sh || true
/Users/satu.salekari@futurice.com/.tmc-autocomplete.sh:44: command not found: complete
/Users/satu.salekari@futurice.com/.tmc-autocomplete.sh:44: command not found: complete
% tmc complete 
Command complete doesn't exist.
% tmc
Usage: tmc [args] COMMAND [command-args]

TMC commands:
  config       Set/unset TMC-CLI properties and change settings
  courses      List the available courses
  download     Download exercises for a specific course
  exercises    List the exercises for a specific course
s11i-code commented 4 years ago

Also this:

%complete                             
zsh: command not found: complete

Does this happen because Apple made zsh the default shell instead of bash for OSX Catalina?

dontepsu commented 3 years ago

+1 OS X Bigsur with zsh.

I have zsh on my other PC with ubuntu and it works.

microwavestine commented 3 years ago

In .zshrc file, add these lines:

autoload -U +X compinit && compinit
autoload -U +X bashcompinit && bashcompinit
source /Users/xxx/.tmc-autocomplete.sh || true

Source: https://stackoverflow.com/questions/3249432/can-a-bash-tab-completion-script-be-used-in-zsh