Wie aktiviere ich die automatische Vervollständigung von Git im integrierten Terminal in VSCode?

Lesezeit: 2 Minuten

Ich verwende VS Code auf dem Mac. Ich verwende häufig das integrierte Terminal in VS Code, um Befehlszeilenoperationen auszuführen, die für meinen Arbeitsbereich/mein Projekt relevant sind [instead of using Terminal or iTerm].

Ich kann die automatische Vervollständigung für grundlegende Shell-Befehle über das integrierte Terminal in VS Code verwenden. Zum Beispiel machen cd gefolgt von einem Tab schlägt mir automatisch mögliche Verzeichnisoptionen vor [just like Terminal or iTerm would].

Dieser automatische Vorschlag funktioniert jedoch nicht für Git-Befehle. Zum Beispiel machen git br gefolgt von einem Tab abschließen soll git branch aber das funktioniert nicht.

Ich habe mir die Benutzereinstellungen in VS Code angesehen [by invoking Cmd + Shift + P -> User Settings -> User -> Extensions -> Git
I verified my default terminal for Mac is “Terminal”. But however, it’s not picking Git commands for autocomplete.

What’s missing?

Related issue: https://github.com/Microsoft/vscode/issues/17748

  • For Bash, see stackoverflow.com/questions/12399002/…

    – phil294

    Jul 13, 2021 at 0:40

If you’re using zsh shell, there is a good and quick solution for it right in this discussion.
Git tab completion not working in zsh on mac

Then in VSCode, choose zsh as your default terminal.

I had same issues with VSCode and Windows 10. The default terminal was set to Powershell. After i installed poshgit https://github.com/dahlbyk/posh-git autocompletion works fine.

If you’re using zsh, you can configure vscode terminal by default with zsh terminal. Go to preferences -> Settings and click on the top right icon to open the json view. Then add the following settings

"terminal.integrated.shell.osx": "/bin/zsh"

This assumes you already have git autocomplete in your zsh terminal but not within vscode. If you don’t have git autocomplete in your terminal, I’d suggest using Oh my zsh which already has nice plugins for git and more.

Add this to your .zshrc: autoload -Uz compinit && compinit

If you’re using MacOS,you could use Fig.
I use it myself and it has great autocomplete, in VSCode’s integrated terminal as well!

fig.io

1429510cookie-checkWie aktiviere ich die automatische Vervollständigung von Git im integrierten Terminal in VSCode?

This website is using cookies to improve the user-friendliness. You agree by using the website further.

Privacy policy