You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zoocode uses RunVsAgent vscode-powershell integrations in Jetbrains IDE's, e.g. PyCharm. The PowerShell profile defined by RunVsAgent is broken and blocks automatic virtual environment activation. It suffers the same issues as reported in Kilo-Org/kilocode#2590 and Kilo-Org/kilocode#2800.
Context (who is affected and when)
The problem occurs when starting a new PowerShell terminal in a Jetbrains IDE. The Powershell profile loads and runs into an error. The first issue is with improper ]-expansion. It returns errors like:
Following the proposed fixes in this PR, solves the issue. The profile now loads correctly.
However, then the second issue pops up, the virtual environment is no longer loaded automatically by the IDE. This PR proposes a fix and manually implementing that also solves the issue.
Now, these changes don't last as reported by that PR. Can these fixes be implemented so they are available for everyone?
Reproduction steps
Used IDE: Pycharm 2026.2.3: Build #PY-262.10968.92, built on September 18, 2026
OS: Windows 11
Open a Pycharm project
Make sure the ZooCode plugin is enabled
Open a fresh PowerShell terminal
Error appears as the profile is run on startup
Expected result
Powershell loads without errors and the project interpreter loads automatically
Actual result
Parsing errors occurred and after fixing that, the virtual environment activation script does not run
I verified both findings. Neither is in this repo: the profile ships from Zoo-Code-Org/Zoo-Code-Jetbrains. WeCoderTerminalCustomizer.kt copies run-vs-agent-shell-integrations/vscode-powershell/profile.ps1 to ~/.run-vs-agent-shell-integrations/ and launches PowerShell terminals with it.
1. Parse error: the cause is file encoding, not ]
Parsing the shipped profile.ps1 with PowerShell's own parser reproduces the report exactly:
Variant
Windows PowerShell 5.1
PowerShell 7
Shipped file
2 errors: line 89 col 21 and line 144, unexpected token ]
profile.ps1 is UTF-8 without a BOM, and Windows PowerShell 5.1 reads BOM-less scripts as Windows-1252. The emoji on lines 9, 10, 28 and 182 (📁, 🔑, 🔍) contain the bytes 0x93/0x94, which Windows-1252 decodes as curly double quotes. PowerShell treats those as string delimiters, so string boundaries drift through the rest of the file and the error surfaces at the ] on line 89. That's why Kilo's quote swap only moves the error. Saving the file with a BOM (as JetBrains' own powershell-integration.ps1 does) or keeping it ASCII-only fixes it. PowerShell 7 reads BOM-less files as UTF-8, which is why only 5.1 users see this.
2. Virtual environment not activated
PyCharm starts PowerShell with -File <IDE>/plugins/terminal/shell-integrations/powershell/powershell-integration.ps1. That script applies the _INTELLIJ_FORCE_* variables and runs $Env:JEDITERM_SOURCE, which is the venv activate script.
injectPowerShellScript replaces that -File argument with our profile.ps1 and stores the original path in ORIGINAL_POWERSHELL_SCRIPT, but profile.ps1 never reads that variable. The JetBrains script therefore never runs, and neither does venv activation.
A simulated launch (stand-in scripts, Windows PowerShell 5.1) confirms it:
-File jb-integration.ps1 → venv activated
-File profile.ps1 with ORIGINAL_POWERSHELL_SCRIPT set → nothing runs
Proposed fix (in Zoo-Code-Jetbrains)
Save profile.ps1 (and diagnose.ps1) as UTF-8 with BOM, or remove the emoji.
After the user profile is loaded, run the script the -File swap replaced:
if ($env:ORIGINAL_POWERSHELL_SCRIPT-and (Test-Path-LiteralPath $env:ORIGINAL_POWERSHELL_SCRIPT)) {
.$env:ORIGINAL_POWERSHELL_SCRIPT
}
$env:ORIGINAL_POWERSHELL_SCRIPT=$null
With both changes, the simulated launch parses cleanly in 5.1 and activates the venv again. This was only tested with stand-in scripts, not in a real PyCharm. The real JetBrains script also installs its own prompt hooks, so how they interact with our Prompt override still needs checking in the IDE.
Activity
PierrunoYT commentedon Sep 28, 2026
Working on it!
PierrunoYT commentedon Sep 28, 2026
I verified both findings. Neither is in this repo: the profile ships from
Zoo-Code-Org/Zoo-Code-Jetbrains.WeCoderTerminalCustomizer.ktcopiesrun-vs-agent-shell-integrations/vscode-powershell/profile.ps1to~/.run-vs-agent-shell-integrations/and launches PowerShell terminals with it.1. Parse error: the cause is file encoding, not
]Parsing the shipped
profile.ps1with PowerShell's own parser reproduces the report exactly:]profile.ps1is UTF-8 without a BOM, and Windows PowerShell 5.1 reads BOM-less scripts as Windows-1252. The emoji on lines 9, 10, 28 and 182 (📁, 🔑, 🔍) contain the bytes0x93/0x94, which Windows-1252 decodes as curly double quotes. PowerShell treats those as string delimiters, so string boundaries drift through the rest of the file and the error surfaces at the]on line 89. That's why Kilo's quote swap only moves the error. Saving the file with a BOM (as JetBrains' ownpowershell-integration.ps1does) or keeping it ASCII-only fixes it. PowerShell 7 reads BOM-less files as UTF-8, which is why only 5.1 users see this.2. Virtual environment not activated
PyCharm starts PowerShell with
-File <IDE>/plugins/terminal/shell-integrations/powershell/powershell-integration.ps1. That script applies the_INTELLIJ_FORCE_*variables and runs$Env:JEDITERM_SOURCE, which is the venvactivatescript.injectPowerShellScriptreplaces that-Fileargument with ourprofile.ps1and stores the original path inORIGINAL_POWERSHELL_SCRIPT, butprofile.ps1never reads that variable. The JetBrains script therefore never runs, and neither does venv activation.A simulated launch (stand-in scripts, Windows PowerShell 5.1) confirms it:
-File jb-integration.ps1→ venv activated-File profile.ps1withORIGINAL_POWERSHELL_SCRIPTset → nothing runsProposed fix (in
Zoo-Code-Jetbrains)profile.ps1(anddiagnose.ps1) as UTF-8 with BOM, or remove the emoji.-Fileswap replaced:With both changes, the simulated launch parses cleanly in 5.1 and activates the venv again. This was only tested with stand-in scripts, not in a real PyCharm. The real JetBrains script also installs its own prompt hooks, so how they interact with our
Promptoverride still needs checking in the IDE.aGitForEveryone commentedon Sep 28, 2026
Awesome analysis! Thanks for picking it up.
aGitForEveryone commentedon Oct 22, 2026
Bumping this issue again. Part of it was addressed in Zoo-Code-Org/Zoo-Code-Jetbrains#10. However, the part where it runs PyCharms activation scripts was not added. I wrote a comment on that in this issue: Zoo-Code-Org/Zoo-Code-Jetbrains#7.
Can the branch that activates Pycharm/JetBrains activation scripts be added?
aGitForEveryone commentedon Oct 27, 2026
Issue has been solved in Jetbrains repo.