stecman / symfony-console-completion

Automatic tab-key completion for Symfony console application options, arguments and parameters
MIT License
420 stars 26 forks source link

Fails to detect bash in FreeBSD #14

Closed pjcdawkins closed 9 years ago

pjcdawkins commented 9 years ago

Testing (masochistically) in FreeBSD 10.0, in a bash shell, I get this:


  [RuntimeException]                                                                
  Cannot generate hook for unknown shell type 'sh'. Available hooks are: bash, zsh  

_completion [-g|--generate-hook] [-p|--program="..."] [--shell-type[="..."]]
pjcdawkins commented 9 years ago

It works if the user changes his/her shell with chsh

aik099 commented 9 years ago

What is sh shell? Is it alias to bash on FreeBSD? If so, then maybe we can alias it in shell detection code as well.

pjcdawkins commented 9 years ago

No it's not bash, although it's similar. http://www.freebsd.org/cgi/man.cgi?query=sh#end

The problem was that the shell type was detected as sh after I believed I had changed to bash by simply running the command bash. Apparently you have to use chsh bash to change the shell in FreeBSD.

aik099 commented 9 years ago

No it's not bash, although it's similar.

Similar to the point, that auto-complete routines work the same way (e.g. there is complete command)?

aik099 commented 9 years ago

In fact you can use --shell-type bash in your hook generation command to generate Bash hook and see if it works. No need to change default shell.