5

I have zsh-completions installed on arch linux. Completion of VBoxManage command seems to work fine, but vboxmanage doesn't (ie. just does simple completion of files int he local directory). Both VBoxManage and vboxmanage are symlinks to the VBox executable.

It seems that my _virtualbox completion definition has a first line of

#compdef VBoxManage=vboxmanage VBoxHeadless=vboxheadless

which looks like an alias of some sort? but it isn't working.

I have a fix which is to change the above line to

#compdef VBoxManage=vboxmanage vboxmanage=vboxmanage VBoxHeadless=vboxheadless vboxheadless=vboxheadless

This seems long-winded, there is an option to specify a pattern, but What is the correct way to alias commands like this?

sw1nn
  • 7,278
  • 1
  • 26
  • 36

1 Answers1

1
compdef _VBoxManage vboxmanage
compdef _VBoxHeadless vboxheadless

In your ~/.zshrc is the correct way to specify a completion function for a command. It is not recommended to edit the actual function in source, for obvious reasons.

PythonNut
  • 6,182
  • 1
  • 25
  • 41