-
Notifications
You must be signed in to change notification settings - Fork 37.6k
Add agent CLIs to shell type detection #290846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for agent CLIs (Claude, Codex, Copilot, and Gemini) to the terminal shell type detection system to enable proper terminal title changes when these CLIs are used as shells.
Changes:
- Added four new GeneralShellType enum values for agent CLIs
- Added mappings for these CLIs in the generalShellTypeMap for non-Windows platforms
- Added Windows-specific executable recognition in SHELL_EXECUTABLES
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/vs/platform/terminal/common/terminal.ts | Defines new GeneralShellType enum values for Claude, Codex, Copilot, and Gemini |
| src/vs/platform/terminal/node/terminalProcess.ts | Adds generalShellTypeMap entries to recognize agent CLI names on non-Windows platforms |
| src/vs/platform/terminal/node/windowsShellHelper.ts | Adds Windows executable names to SHELL_EXECUTABLES for agent CLIs |
Comments suppressed due to low confidence (1)
src/vs/platform/terminal/node/windowsShellHelper.ts:41
- Adding .ps1 files to SHELL_EXECUTABLES is unusual - typically only .exe files are process names in the Windows process tree. PowerShell scripts (.ps1) usually show up as powershell.exe or pwsh.exe processes in the process tree, not as the script filename. Verify that these agent CLIs actually appear as 'codex.ps1', 'copilot.ps1', and 'gemini.ps1' in the Windows process tree. If they don't, these entries may never match and should be removed or handled differently.
'codex.ps1',
'copilot.ps1',
'gemini.ps1',
| Codex = 'codex', | ||
| Copilot = 'copilot', | ||
| Claude = 'claude', | ||
| Gemini = 'gemini', |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The enum values are not in alphabetical order. The new agent CLI entries (Claude, Codex, Copilot, Gemini) should come after Julia, NuShell, Node, and Xonsh to maintain alphabetical ordering, consistent with the pattern in PosixShellType enum.
| ['claude', GeneralShellType.Claude], | ||
| ['codex', GeneralShellType.Codex], | ||
| ['copilot', GeneralShellType.Copilot], | ||
| ['gemini', GeneralShellType.Gemini], |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The map entries are not in alphabetical order. The new agent CLI entries (claude, codex, copilot, gemini) should be inserted after 'julia', 'node', 'nu', and 'xonsh' to maintain alphabetical ordering, consistent with the ordering in posixShellTypeMap above.
| 'claude.exe', | ||
| 'codex.ps1', | ||
| 'copilot.ps1', | ||
| 'gemini.ps1', |
Copilot
AI
Jan 27, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getShellType method in windowsShellHelper.ts needs to be updated to handle the newly added shell types. Currently, this method returns undefined for 'claude.exe', 'codex.ps1', 'copilot.ps1', and 'gemini.ps1' even though they are now recognized in SHELL_EXECUTABLES. Add cases for these executables that return the corresponding GeneralShellType values (GeneralShellType.Claude, GeneralShellType.Codex, GeneralShellType.Copilot, GeneralShellType.Gemini).
Part of #290830