- Issue Type:
Performance
- Extension Name:
vscode-python-envs
- Extension Version:
1.37.2026072901
- OS Version:
Linux x64 7.1.5-arch1-2
- VS Code version:
1.131.0
Claude finally figured out why VS Code has become horribly slow for me when I use the terminal, and eventually stops working completely – it’s you!
This function is broken, the regex is extremely bad and will slow down things when there is moderate amounts of terminal output:
|
export function isPackageModifyingCommand(command: string): boolean { |
How to fix
The issue is probably this regex part: (?:\S+\s+)*, which both does catastrophic backtracking and might hang forever. It is also completely useless since you already test, which isn’t anchored to the start of the string anyway.
Remove that, and ideally also just remove the terminal watcher until you have a benchmark setup in CI that tells you that it works much more efficiently than it does today.
ms-python.vscode-python-envs-unresponsive.cpuprofile.txt
Workaround
Disabling terminal integration disables the event being fired, but of course also more than that
Performancevscode-python-envs1.37.2026072901Linux x64 7.1.5-arch1-21.131.0Claude finally figured out why VS Code has become horribly slow for me when I use the terminal, and eventually stops working completely – it’s you!
This function is broken, the regex is extremely bad and will slow down things when there is moderate amounts of terminal output:
vscode-python-environments/src/features/terminal/terminalPackageWatcher.ts
Line 13 in 64db682
How to fix
The issue is probably this regex part:
(?:\S+\s+)*, which both does catastrophic backtracking and might hang forever. It is also completely useless since you alreadytest, which isn’t anchored to the start of the string anyway.Remove that, and ideally also just remove the terminal watcher until you have a benchmark setup in CI that tells you that it works much more efficiently than it does today.
ms-python.vscode-python-envs-unresponsive.cpuprofile.txt
Workaround
Disabling terminal integration disables the event being fired, but of course also more than that
{ // https://github.com/microsoft/vscode-python-environments/issues/1683 "terminal.integrated.shellIntegration.enabled": false, }