Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 31, 2025

This PR adds a dropdown menu to the terminal command confirmation dialog, allowing users to quickly configure auto-approval settings for commands. Previously, users had to manually edit settings to add commands to the auto-approve list - now they can do it directly from the confirmation dialog.

Implementation

When a terminal command requires confirmation, the "Continue" button now includes a dropdown with contextual options:

  • Always allow [exact command] - Adds the specific command to the auto-approve list
  • Always allow [base command] commands - Adds the base command (e.g., npm) to approve all commands starting with it (only shown for multi-word commands)
  • Configure auto approve... - Opens the settings page for advanced configuration

Similar to workspace trust dialogs, the dropdown provides smart options based on the command structure:

// For "npm run build":
[
  { label: "Always allow `npm run build`", type: "exact" },
  { label: "Always allow `npm` commands", type: "prefix" }, 
  { label: "Configure auto approve...", type: "configure" }
]

// For single commands like "git":
[
  { label: "Always allow `git`", type: "exact" },
  { label: "Configure auto approve...", type: "configure" }
]

Technical Details

  • Extended IToolConfirmationMessages interface with customActions property
  • Added _generateAutoApproveActions() method in RunInTerminalTool to create contextual dropdown options
  • Enhanced ToolConfirmationSubPart to handle custom actions and update the chat.tools.terminal.autoApprove configuration
  • Leverages existing moreActions dropdown infrastructure from the confirmation widget
  • Includes comprehensive tests for various command scenarios

The feature integrates seamlessly with the existing auto-approval system and maintains consistency with VS Code's confirmation dialog patterns.

Terminal confirmation dialog showing the new dropdown options

Fixes #253268.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • electronjs.org
    • Triggering command: node-gyp (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Provide UI entry point for adding to the terminal auto-approve allow list Add UI entry point for terminal auto-approve dropdown Jul 31, 2025
Copilot AI requested a review from Tyriar July 31, 2025 13:37
Copilot finished work on behalf of Tyriar July 31, 2025 13:37
@Tyriar Tyriar added this to the August 2025 milestone Aug 7, 2025
@Tyriar Tyriar marked this pull request as ready for review August 7, 2025 16:54
@Tyriar Tyriar merged commit d82fbd4 into main Aug 7, 2025
18 checks passed
@Tyriar Tyriar deleted the copilot/fix-253268 branch August 7, 2025 18:10
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Sep 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide UI entry point for adding to the terminal auto-approve allow list

3 participants