Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion doesn't work on macOS (or zsh)? #271

Open
sampotter opened this issue Jul 18, 2021 · 2 comments
Open

Tab completion doesn't work on macOS (or zsh)? #271

sampotter opened this issue Jul 18, 2021 · 2 comments

Comments

@sampotter
Copy link

Probably pretty similar to issue #270, which I opened yesterday.

Although it isn't documented yet in cgreen's manual, from what I've picked up looking at other issues, it seems that tab completion for tests has some level of support in cgreen-runner? If I try:

cgreen-runner libtests.so suite:<TAB>

on macOS using zsh, nothing happens. Maybe the implementation of tab completion for cgreen-runner relies on some features of bash that aren't present under zsh? (Apart from using bash and zsh daily, I don't know very much about how they work as programming environments.)

@thoni56
Copy link
Contributor

thoni56 commented Jul 18, 2021

As I stated in #270 zsh completion is different from bash's and have not been addressed.

Have you tried it in bash (Brew's bash, not Darwins old version...)? It was not easy to figure out if there is a "general" location for completion files. I find that on my Mac I sometimes get it to work and sometimes not. But nowadays with Darwins Bash 3.x, Brews Bash 4.x and Darwins zsh (there's probably a Brew zsh too...) and also ARM and i386 Brew versions I tend to get very confused about what environment I actually have...

@thoni56
Copy link
Contributor

thoni56 commented Feb 9, 2023

In 98c2550 I did some modifications to the completion script that make them work (almost) in Zsh also.

In your .zshrc add the following lines

autoload -Uz compinit
compinit
# load bashcompinit for bash completions

autoload bashcompinit && bashcompinit

Then you can

# source <path to cgreen_completion.bash>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants