-
Notifications
You must be signed in to change notification settings - Fork 670
Description
Bug: CLI intercepts command names in text responses and attempts to execute them
Description
The GitHub Copilot CLI incorrectly intercepts command names (like kill, pkill) that appear in text responses and attempts to execute them as system commands. This breaks normal conversation context and makes it impossible to discuss certain system utilities.
Steps to Reproduce
- Start a conversation about building OS utilities
- Use the
sessioncommand to record text containing words like "kill" or "pkill" - CLI intercepts these words and tries to execute them as commands
- Get error:
Command not executed. The 'kill' command must specify at least one numeric PID.
Example
When trying to record this text:
session me "Built chmod, grep, ps, and kill commands"CLI output:
Command not executed. The 'kill' command must specify at least one numeric PID. Usage: kill <PID> or kill -9 <PID>
Expected Behavior
The CLI should distinguish between:
- Talking ABOUT a command in text/conversation ("we should build the kill command")
- Executing a command (actual tool invocation with
bashtool)
Text passed to other tools (like session) should NOT be intercepted and interpreted as executable commands.
Actual Behavior
The CLI aggressively pattern-matches certain command names in ANY context and attempts to execute them, even when they're part of text arguments to other tools.
Impact
- Breaks OS development conversations - Can't discuss process management utilities
- Forces awkward workarounds - Have to rename commands (e.g., "termproc" instead of the k-word)
- Context-unaware - No understanding of which tool is being called
- Overly aggressive - Intercepts text that's clearly not a command invocation
Environment
- GitHub Copilot CLI version: 0.0.369
- OS: Linux (Ubuntu 24.04)
- Use case: Building BarrerOS (C# operating system)
Suggested Fix
The command interception logic should:
- Only apply to direct
bashtool invocations - NOT intercept text arguments passed to other tools
- Require explicit command syntax (e.g.,
bash kill 1234) - Ignore command names that appear in quoted strings or tool parameters
Workaround
Currently using alternative command names to avoid interception (e.g., termproc instead of kill).
Related
This is particularly problematic for:
- Operating system development
- Systems programming discussions
- DevOps/infrastructure work
- Any conversation about process management
Note: This bug makes it impossible to have normal technical conversations about certain system utilities. The CLI should be context-aware enough to know when text is part of a conversation vs. an executable command.