When I run complete -C from my regular terminal fish shell I get a list of ~4k commands, which is great. I want this to happen from my python script. I have the following but it doesn't work:
command = "fish -c 'complete -C'"
output = (
subprocess.run(command, shell=True, capture_output=True).stdout.decode().strip()
)
The output stdout is just an empty string. The stderr is showing:
complete: -C: option requires an argument
Standard input (line 1):
complete -C
(Type 'help complete' for related documentation)"
How can I get this to work? Is there something outside of python subprocess I can use for this?
When you type
complete -Cin normal fish prompt it gets converted to complete -C ''so you have to do: