Skip to content

2>/dev/null still requires permission #2693

@eihigh

Description

@eihigh

Describe the bug

Issue #211 is still bothering me even in v1.0.25. Copilot tried to run a harmless command like this via the shell tool, but as you can see it still asks for permission:

◐ The user is asking about the "XXX" command. Let me look at the repository structure to understand what this command does.

● List directory .
  └ 30 files found

● View XXX command script (shell)
  └ cat /Users/XXX/XXX/XXX 2>/dev/null | head -80

╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ View XXX command script                                                                                                                                             │
│ ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── │
│ ╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │
│ │ cat /Users/XXX/XXX/XXX 2>/dev/null | head -80                                                                                        │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
│                                                                                                                                                                       │
│ Do you want to run this command?                                                                                                                                      │
│                                                                                                                                                                       │
│ ❯ 1. Yes                                                                                                                                                              │
│   2. No, and tell Copilot what to do differently (Esc to stop)                                                                                                        │
│                                                                                                                                                                       │
│ ↑↓ to navigate · Enter to select · Esc to cancel                                                                                                                      │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Affected version

GitHub Copilot CLI 1.0.25.

Steps to reproduce the behavior

  1. Run Copilot.
  2. Ask it to explore some code.
  3. Occasionally, Copilot will try to execute a shell command that includes an stderr redirect to /dev/null.
  4. It will prompt for permission.

Expected behavior

Copilot does not ask for permission

Additional context

macOS, zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions