DEV Community

Cover image for Adding Auto-Complete Feature in VS Code terminal
Sujal Shah
Sujal Shah

Posted on

Adding Auto-Complete Feature in VS Code terminal

PowerShell 7 is the latest version of PowerShell, and it brings many new features and enhancements that make it an attractive choice for developers and system administrators alike.

One of its most useful features is the auto-complete feature, which can save you time and reduce typing errors. In this article, we'll show you how to add the auto-complete feature using PowerShell 7 in Visual Studio Code (VS Code).

How it works?
Actually there is no AI or magic, but this terminal auto completes based on bash history and tries to auto complete the command you used most frequently.

Step 1: Install PowerShell 7:

First, you'll need to install PowerShell 7 on your system. You can download the latest version from the official PowerShell website. Once downloaded, install it by following the installation wizard.

Supported versions of windows

Supported versions of windows

Step 2: Add PowerShell 7 in VS Code



{
  "terminal.integrated.defaultProfile.windows": "PowerShell 7",
  "terminal.integrated.profiles.windows": {
    "Command Prompt": {
      "args": [],
      "icon": "terminal-cmd",
      "path": [
        "${env:windir}\\Sysnative\\cmd.exe",
        "${env:windir}\\System32\\cmd.exe"
      ]
    },
    "Git Bash": {
      "source": "Git Bash"
    },
    "PowerShell": {
      "icon": "terminal-powershell",
      "source": "PowerShell"
    },
    "PowerShell 7": {
      "args": [],
      "icon": "terminal-powershell",
      "path": "C:\\Program Files\\PowerShell\\7\\pwsh.exe"
    }
  },
}


Enter fullscreen mode Exit fullscreen mode

Note: Path may vary if you have choose different installation location. Here I followed all the default settings while installing

We added new profile PowerShell 7 in terminal and set as default one.

default bash profile

Results:

Autocomplete Results

Top comments (3)

Collapse
 
shukonee profile image
Shukonee

Where am i supposed to put the code?

Collapse
 
harshal_dongre profile image
Harshal Dongre

It worked. ThanxπŸ˜‰

Collapse
 
adem_belaid profile image
Adem belaid

So usefull thank you so much, it worked perfectly ^^