PowerShell Extension Terminal intermittently crashes in PsesInternalHost.OnPowerShellIdle without event subscribers
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 12/100
Piste de recherche
The stack trace points to PsesInternalHost.OnPowerShellIdle at PsesInternalHost.cs line 1263, which lives in the PowerShell Editor Services sources rather than this TypeScript extension repo. Start by reading how the idle handler starts its synchronous task while another pipeline may still be running, and compare with #4851 and #3701. Done means the idle path never runs a pipeline concurrently, which needs a reproduction the issue does not yet provide.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Prerequisites
- I have written a descriptive issue title.
- I have searched all open and closed issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- I have verified the installed Visual Studio Code and PowerShell extension versions.
- This is not a security issue.
Summary
The PowerShell Extension Terminal intermittently throws PSInvalidOperationException from PsesInternalHost.OnPowerShellIdle and then terminates while the terminal is idle. No PowerShell.OnIdle or other event subscribers are registered.
This has occurred repeatedly during normal editor use and also while neither keyboard input nor clipboard activity was taking place. The Last N Keys shown by PSReadLine can contain earlier input and does not correspond to input at the time of the failure.
The same class of failure was previously observed with the stable extension, and it still occurs with PowerShell extension 2026.1.2 / PowerShell Editor Services 4.7.0 and PSReadLine 2.4.5.
PowerShell Version
Name Value
---- -----
PSVersion 7.6.6
PSEdition Core
GitCommitId 7.6.6
OS Ubuntu 24.04.5 LTS
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Name : Visual Studio Code Host
Version : 2026.1.2
InstanceId : [redacted]
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Visual Studio Code Version
1.140.0
07f806f999227108933c2e30515b26eecc1fda74
x64
Extension Version
[email protected]
PowerShell Editor Services startup log:
Editor Services version: 4.7.0
Build commit: 1cf4500fc2382f2431615fd9a45bbe0cd26747ff
REPL configured as PSReadLine
PowerShell version: 7.6.6
Steps to Reproduce
The failure is intermittent rather than deterministically timed:
-
Start Visual Studio Code with the PowerShell extension.
-
Open the PowerShell Extension Terminal.
-
Confirm that no event subscribers are registered:
Get-EventSubscriber -ForceThe command returns no output.
-
Use VS Code normally, including opening or editing PowerShell files, then leave the Extension Terminal idle.
-
After an unpredictable amount of time, PSReadLine prints the exception below and the extension terminal process terminates.
No command needs to be running and no terminal input is required when the exception occurs.
Expected Behavior
The PowerShell Extension Terminal remains available while idle, including while the editor and language service process file or configuration changes.
Actual Behavior
The Extension Terminal intermittently throws a concurrent-pipeline exception from PsesInternalHost.OnPowerShellIdle. VS Code subsequently reports that the PowerShell process terminated or the Extension Terminal was closed.
Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
### Environment
PSReadLine: 2.4.5
PowerShell: 2026.1.2
OS: Ubuntu 24.04.5 LTS
BufferWidth: 126
BufferHeight: 19
Last 2 Keys:
p p
### Exception
System.Management.Automation.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.
at System.Management.Automation.Runspaces.PipelineBase.CoreInvoke(IEnumerable input, Boolean syncCall)
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteNormally(CancellationToken cancellationToken) in C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 108
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 77
--- End of stack trace from previous location ---
at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.OnPowerShellIdle(CancellationToken idleCancellationToken) in C:\__w\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 1263
at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)
Extension log at termination:
[warning] PowerShell process terminated or Extension Terminal was closed
[error] The PowerShell Extension Terminal has stopped, would you like to restart it? IntelliSense and other features will not work without it!
There was no kernel OOM kill, segmentation fault, or coredump associated with the termination.
Related Issues
- #4851 has the same exception but provides a deterministic reproduction by explicitly registering
PowerShell.OnIdle. In this case,Get-EventSubscriber -Forcereturns no subscribers, so the failure occurs without that prerequisite. - #3701 and PowerShell/PowerShellEditorServices#1591 describe the earlier OnIdle/event-handling race that was considered fixed in 2022. The current stack indicates a regression or a remaining path to the same concurrent-pipeline condition.
- Langage dominant
- TypeScript
- Étoiles
- 1.9k
- Forks
- 552
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de PowerShell/vscode-powershell
-
agentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
PowerShell/vscode-powershell#5656 ·
-
[aw] Agentic Issue Triage failedOuverteagentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
PowerShell/vscode-powershell#5615 · 1 commentaire ·
-
agentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
PowerShell/vscode-powershell#5607 ·
-
[aw] Agentic Issue Triage failedOuverteagentic-workflows
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
PowerShell/vscode-powershell#5599 · 3 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
PowerShell/vscode-powershell#5592 · 2 commentaires · 1 réaction ·
Toutes les issues de PowerShell/vscode-powershell
Issues similaires
-
[Bug]: Pen taps on sidebar rows start a drag and lose their clickPeut-être pris @makhnatkin l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
b310-digital/teammapper#1515 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
puckeditor/puck#1884 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
outline/outline#14378 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
nicobailon/pi-web-access#642 ·
Les mainteneurs répondent en général sous 1 jour