diff --git a/jetbrains_plugin/src/main/resources/run-vs-agent-shell-integrations/vscode-powershell/profile.ps1 b/jetbrains_plugin/src/main/resources/run-vs-agent-shell-integrations/vscode-powershell/profile.ps1 index 106fee6..ee172ef 100644 --- a/jetbrains_plugin/src/main/resources/run-vs-agent-shell-integrations/vscode-powershell/profile.ps1 +++ b/jetbrains_plugin/src/main/resources/run-vs-agent-shell-integrations/vscode-powershell/profile.ps1 @@ -42,6 +42,12 @@ if ($env:VSCODE_INJECTION -eq "1") { $env:VSCODE_INJECTION = $null } +$jetbrainsScript = $env:ORIGINAL_POWERSHELL_SCRIPT +if ($jetbrainsScript -and (Test-Path -LiteralPath $jetbrainsScript)) { + . $jetbrainsScript +} +$env:ORIGINAL_POWERSHELL_SCRIPT = $null + $Global:__VSCodeOriginalPrompt = $function:Prompt $Global:__LastHistoryId = -1 $Global:__VSCodeIsInExecution = $false