Skip to content
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

PSReadline Exception in VSCode #1789

Closed
3 tasks done
GnicksHGV opened this issue May 4, 2022 · 4 comments
Closed
3 tasks done

PSReadline Exception in VSCode #1789

GnicksHGV opened this issue May 4, 2022 · 4 comments

Comments

@GnicksHGV
Copy link

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest released version
  • Search the existing issues, especially the pinned issues.

Exception report

Oops, something went wrong.
Please report this bug with ALL the details below, including both the 'Environment' and 'Exception' sections.
Please report on GitHub: https://github.com/PowerShell/PSReadLine/issues/new?template=Bug_Report.yaml
Thank you!

### Environment
PSReadLine: 2.2.5
PowerShell: 2022.5.0
OS: Microsoft Windows 10.0.19044
BufferWidth: 518
BufferHeight: 35

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.DoConcurrentCheck(Boolean syncCall, Object syncObject, Boolean isInLock)
   at System.Management.Automation.Runspaces.RunspaceBase.DoConcurrentCheckAndAddToRunningPipelines(PipelineBase pipeline, Boolean syncCall)
   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, Boolean isSync)
   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 System.Management.Automation.PowerShell.Invoke[T](IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Utility.PowerShellExtensions.InvokeAndClear[TResult](PowerShell pwsh, PSInvocationSettings invocationSettings) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Utility\PowerShellExtensions.cs:line 82
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.ExecuteNormally(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 186
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousPowerShellTask`1.Run(CancellationToken cancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousPowerShellTask.cs:line 77
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.ExecuteSynchronously(CancellationToken executorCancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 102
--- End of stack trace from previous location ---
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Execution.SynchronousTask`1.get_Result() in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Execution\SynchronousTask.cs:line 55
   at Microsoft.PowerShell.EditorServices.Services.PowerShell.Host.PsesInternalHost.OnPowerShellIdle(CancellationToken idleCancellationToken) in D:\a\_work\1\s\src\PowerShellEditorServices\Services\PowerShell\Host\PsesInternalHost.cs:line 1038
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken, Nullable`1 lastRunStatus)

Screenshot

PSException

Environment data

PS Version: 7.2.2
PS HostName: Visual Studio Code Host
PSReadLine Version: 2.2.5
PSReadLine EditMode: Windows
OS: 10.0.19041.1 (WinBuild.160101.0800)
BufferWidth: 518
BufferHeight: 78

Steps to reproduce

Any
Just opening the PS Terminal in VSCode
Using standard PS Terminal for PS 7.2, 7.3.0.Preview3 works as expected.
7.2 and 7.3.0.P3 in VSCode result same exceptions.

Expected behavior

No Exceptions

Actual behavior

The Exception Above

@ghost ghost added the Needs-Triage 🔍 label May 4, 2022
@daxian-dbw daxian-dbw transferred this issue from PowerShell/PSReadLine May 4, 2022
@ghost ghost added the Needs: Triage Maintainer attention needed! label May 4, 2022
@daxian-dbw
Copy link
Member

@GnicksHGV do you have any event subscribers registered by default? Get-EventSubscriber -Force should return any subscribers.
@andschwa I think this is a duplicate of PowerShell/vscode-powershell#3701

@andyleejordan
Copy link
Member

I think so too. @GnicksHGV Can you follow the instructions for the last bullet point in this list?

  • PSReadLine throws an error ever so often, [#3701][].

    • This is a known issue due to the PowerShell eventing framework running registered
      OnIdle events outside of PowerShell Editor Service's dedicated PowerShell execution
      pipeline. Until we can disable event registration, you will need to avoid registering
      events in the first place.

    • A known work around includes unregistering from this event. Get-EventSubscriber -Force -SourceIdentifier PowerShell.OnIdle -EA 0 | Unregister-Event -Force can be run
      manually (or added to your profile) to avoid this bug.

    • Also see: PowerShell Editor Services #1591,
      PSReadLine #3091,
      and Azure PowerShell #16585.

@SydneyhSmith
Copy link
Collaborator

@GnicksHGV this may be fixed now, can you please let us know if you are still having this issue?

@SydneyhSmith SydneyhSmith added Needs-Repro-Info and removed Needs: Triage Maintainer attention needed! Needs-Triage 🔍 labels May 24, 2022
@ghost
Copy link

ghost commented Jun 1, 2022

This issue was closed automatically as repro info was indicated as needed, but there has been no activity in over a week. Please feel free to reopen with any available information!

@ghost ghost closed this as completed Jun 1, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants