github / github/copilot-cli

Feature Request: Load user shell configuration files when executing commands

Đang mở
#1,131 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:non-interactive area:tools
Ngôn ngữ chính
Shell
Star
11.2k
Fork
1.9k
Merge trung bình
14 giờ 16 phút
Pull request đã merge (30 ngày)
6

Mô tả

### Describe the feature or problem you'd like to solve

Commands executed via the `!` prefix or `bash` tool don't load user shell configuration files (.zshrc, .zprofile, .bashrc), causing PATH issues, missing aliases/functions, and inconsistent behavior with the user's normal terminal environment.

### Proposed solution

Allow users to specify which shell to use when executing commands, and have that shell load the user's configuration files.

How it benefits Copilot CLI and its users:
- Consistency: Commands behave the same way in Copilot CLI as in the user's normal terminal
- Zero configuration: Users can immediately access their existing shell setup without duplicating configurations
- Team productivity: Teams with standardized shell configurations can use them seamlessly
- Developer experience: Reduces friction and cognitive load when switching between terminal and Copilot CLI
- Tool compatibility: Modern development tools (version managers, containerization tools, etc.) work out of the box

Implementation approach:
- Respect the $SHELL environment variable to determine which shell to use
- Or provide a configuration option to specify the preferred shell
- Invoke the shell in interactive/login mode to load rc files (e.g., `zsh -l -i -c "command"` instead of `sh -c "command"`)

### Example prompts or workflows

1. Custom PATH from .zshrc
User has custom tooling paths defined in .zshrc:
# ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
export PATH="/opt/homebrew/bin:$PATH"

With this feature: `! mytool --version` would automatically access tools in the custom PATH.

2. Team-specific aliases
Development team uses shared zsh aliases:
# ~/.zshrc
alias dc='docker-compose'
alias k='kubectl'

### Additional context

- GitHub Copilot CLI version: v0.0.395
- Operating System: macOS
- Current workaround:
- Manually use `! zsh -l -i -c "command"` for each command
- Or define environment variables in .zshenv (loaded in non-interactive mode, but not standard for most users)
- Impact: This affects any user who has customized their shell environment, which is common practice in software development

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.