-
Notifications
You must be signed in to change notification settings - Fork 757
Open
Labels
Description
Problem
When the Copilot CLI bash tool runs commands, it doesn't respect user shell configurations like BASH_ENV, ~/.bashrc, or custom functions/aliases.
Use Case
I have a safety wrapper function in ~/.funcs.sh that overrides rm to use trash (move to macOS Trash instead of permanent deletion):
function rm() {
local files=()
for arg in "$@"; do
if [[ "$arg" != -* ]]; then
files+=("$arg")
fi
done
trash "${files[@]}" 2>/dev/null || true
}I set export BASH_ENV=~/.bash_env.sh in ~/.zshenv, which sources my functions. This works for bash -c 'type rm' in subshells, but the Copilot CLI's bash tool doesn't pick it up.
Current Behavior
BASH_ENVis inherited by the Copilot CLI process- But bash commands run via the tool still use
/bin/rminstead of my function - User safety wrappers and aliases are ignored
Expected Behavior
Option to source user config before running commands, e.g.:
- Respect
BASH_ENVfor command execution - Or add a flag/config like
--rc-file ~/.bash_env.sh - Or a config option in
~/.config/github-copilot/config.json
Environment
- macOS (Darwin)
- Copilot CLI version: 0.0.365
- Shell: zsh (launching copilot), bash (tool execution)
Workaround
Currently documenting in my AGENTS.md to use trash instead of rm, but this requires remembering to instruct the AI agent explicitly.