You are not logged in.

#1 2019-10-02 15:36:31

solarc
Member
Registered: 2017-01-03
Posts: 5

Issue and fix with code (vscode) bash completion

The community/code package was failing at completing both options and filenames when running it from bash. Looking at the bash completion files I found it was using a placeholder @@APPNAME@@ instead of the name of the program. I just fixed it with this:

sed -i 's/@@APPNAME@@/code/g' /usr/share/bash-completion/completions/code
sed -i 's/@@APPNAME@@/code-oss/g' /usr/share/bash-completion/completions/code-oss

I'm posting this in case anyone else has the same issue with it.

I also see in the PKGBUILD it has a sed line for the completion file (but for adding code-oss rather than replacing the placeholder) so the file upstream must have changed since it was made. I guess it can be fixed by replacing the lines with this:

  # Add missing executable name to bash completion
  sed -i 's|@@APPNAME@@|code|' resources/completions/bash/code
  sed -i 's|@@APPNAME@@|code-oss|' resources/completions/bash/code-oss
  # Create new zsh completion file for our binary
  cp resources/completions/zsh/_code resources/completions/zsh/_code-oss
  sed -i 's|@@APPNAME@@|code code-oss|' resources/completions/zsh/_code-oss

Offline

Board footer

Powered by FluxBB