From the course: AI-Powered Development: GitHub Copilot in Visual Studio Code

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Use terminal with background agent

Use terminal with background agent

This example involves an extensive refactor, so the background agent naturally took some time to process and present the results. I was prompted by Copilot to allow some PowerShell actions during that process, like when it needed to add some files to the project. You can see some of the files that were added here in this files created slash modified section. It's important to note that while the agent works autonomously in the background in a get work tree on your machine, it still operates within your local environment. This means it will still be prompted to approve certain terminal commands. So by default, VS Code requires a manual allow for any command not on a pre-approved list, which is a critical security layer that prevents the AI from accidentally performing destructive actions. You can see what auto-approved actions are configured here in settings. So if you go to settings and look for auto-approve, there's two sections here for chat tools. Let's look at this lower one here,…

Contents