I decided to review pull request #1281. Since I use fish, a shell that currently does not support command completion for kdb, I created a very basic completion file called kdb.fish. Currently this file looks like this:
function __fish_kdb_complete
kdb | awk '/Known commands are:/,empty' | awk '{if(NR>1)print}'
end
complete --command kdb --exclusive --arguments '(__fish_kdb_complete)'
. The problem with the completion command is, that kdb prints escape sequences to color its output. These escape sequences are currently also part of the completion:

. I tried to call kdb with the option -C to disable color output, but unfortunately that does not work:
The command kdb -C is not known
…
. As far as I can remember the Bash completion command has the same problem. Is there an easy way to disable colored out for the command kdb? If there is none, could we please add an option to disable the colored output.
Thanks for reporting!
I decided to review pull request #1281.
You should keep in mind that this PR is more about requirement gathering than something finished. Maybe you can also give hints what would be needed for the fish shell.
The problem with the completion command is, that kdb prints escape sequences to color its output.
Is there an easy way to disable colored out for the command kdb?
It is difficult to fix because unknown commands abort before command-line parsing starts. Thus -C has no effect in these early-abort situations.
If there is none, could we please add an option to disable the colored output.
I fixed it with a new command list-commands which supports listing the commands without explanations and also supports -0 and -C.
Most helpful comment
Thanks for reporting!
You should keep in mind that this PR is more about requirement gathering than something finished. Maybe you can also give hints what would be needed for the fish shell.
It is difficult to fix because unknown commands abort before command-line parsing starts. Thus
-Chas no effect in these early-abort situations.I fixed it with a new command
list-commandswhich supports listing the commands without explanations and also supports-0and-C.