Vscode-powershell: 2.0.0-insiders-834: prompt gets displayed in an endless loop

Created on 10 Oct 2018  Â·  68Comments  Â·  Source: PowerShell/vscode-powershell

Issue Description

When I open a folder containing PowerShell scripts, the integrated terminal displays the prompt in an endless loop, as if I would press and hold the Enter key for it to autorepeat.

Attached Logs

See 1539111398-a60423be-01d3-4cc1-83df-f15ead97e8aa1539111394598.zip

Environment Information

Visual Studio Code

| Name | Version |
| --- | --- |
| Operating System | Windows_NT x64 10.0.17763 |
| VSCode | 1.28.0|
| PowerShell Extension Version | 2.0.0-insiders-834 |

PowerShell Information

|Name|Value|
|---|---|
|PSVersion|5.1.17763.1|
|PSEdition|Desktop|
|PSCompatibleVersions|1.0 2.0 3.0 4.0 5.0 5.1.17763.1|
|BuildVersion|10.0.17763.1|
|CLRVersion|4.0.30319.42000|
|WSManStackVersion|3.0|
|PSRemotingProtocolVersion|2.3|
|SerializationVersion|1.1.0.1|

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)

|Extension|Author|Version|
|---|---|---|
|beautify|HookyQR|1.4.4|
|cpptools|ms-vscode|0.19.0|
|csharp|ms-vscode|1.16.2|
|path-intellisense|christian-kohler|1.4.2|
|PowerShell|ms-vscode|2.0.0-insiders-834|
|prettier-vscode|esbenp|1.6.1|
|printcode|nobuhito|3.0.0|
|vscode-color|anseki|0.4.5|
|vscode-html-css|ecmel|0.2.0|
|vscode-javascript-snippet-pack|akamud|0.1.5|
|vscode-npm-script|eg2|0.3.5|
|vscode-standardjs|chenxsan|1.2.3|
|vscode-tidyhtml|anweber|1.10.0|;

Area-PSReadLine Issue-Bug

Most helpful comment

Hi everyone! If you can, please try out this version of PSReadLine:
PSReadLine.zip

To be sure you're using that version, I recommend:

  • Unblock the files
  • make sure it's the ONLY PSRL available on the PSES module path ($env:PSModulePath)
  • run gmo PSReadLine | % { $_.PrivateData.PSData } and make sure it says beta4

Please let me know if this fixes the issue or if you need any assistance getting beta4. Keep in mind, this is not a signed version of PSRL and should only be used for testing this bug fix.

cc @SteveL-MSFT @rjmholt

All 68 comments

Seems logs didn't make it via drag-and-drop.

1539111398-a60423be-01d3-4cc1-83df-f15ead97e8aa1539111394598.zip

This seems to be the relevant part of the log:

2018-10-09 20:57:11.511 [VERBOSE] C:\projects\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommand', line 622:
    Attempting to execute command(s):


            [System.Diagnostics.DebuggerHidden()]
            [System.Diagnostics.DebuggerStepThrough()]
            param()
            return [Microsoft.PowerShell.PSConsoleReadLine, Microsoft.PowerShell.PSReadLine2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]::ReadLine(
                $Host.Runspace,
                $ExecutionContext,
                $args[0]) System.Threading.CancellationToken


2018-10-09 20:57:11.513 [ERROR] C:\projects\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: In method 'ExecuteCommand', line 692:
    Execution of the following command(s) completed with errors:


            [System.Diagnostics.DebuggerHidden()]
            [System.Diagnostics.DebuggerStepThrough()]
            param()
            return [Microsoft.PowerShell.PSConsoleReadLine, Microsoft.PowerShell.PSReadLine2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null]::ReadLine(
                $Host.Runspace,
                $ExecutionContext,
                $args[0]) System.Threading.CancellationToken

    Error #1:
    Exception calling "ReadLine" with "3" argument(s): "The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception."
    ScriptStackTrace:
    at <ScriptBlock>, <No file>: line 5
    Exception:
       System.Management.Automation.MethodInvocationException: Exception calling "ReadLine" with "3" argument(s): "The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception." ---> System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.Keys' threw an exception. ---> System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.PowerShell.Keys..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.PowerShell.PSConsoleReadLine..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
       at CallSite.Target(Closure , CallSite , Type , Object , Object , Object )
       --- End of inner exception stack trace ---
       at System.Management.Automation.ExceptionHandlingOps.ConvertToMethodInvocationException(Exception exception, Type typeToThrow, String methodName, Int32 numArgs, MemberInfo memberInfo)
       at CallSite.Target(Closure , CallSite , Type , Object , Object , Object )
       at System.Dynamic.UpdateDelegates.UpdateAndExecute4[T0,T1,T2,T3,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3)
       at System.Management.Automation.Interpreter.DynamicInstruction`5.Run(InterpretedFrame frame)
       at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)InnerException:
       System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.PSConsoleReadLine' threw an exception. ---> System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.Keys' threw an exception. ---> System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.PowerShell.Keys..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.PowerShell.PSConsoleReadLine..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)
       at CallSite.Target(Closure , CallSite , Type , Object , Object , Object )InnerException:
       System.TypeInitializationException: The type initializer for 'Microsoft.PowerShell.Keys' threw an exception. ---> System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.PowerShell.Keys..cctor()
       --- End of inner exception stack trace ---
       at Microsoft.PowerShell.PSConsoleReadLine..cctor()InnerException:
       System.ArgumentException: An item with the same key has already been added.
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Microsoft.PowerShell.Keys..cctor()

@sba923 Out of curiosity:

  • Does your normal PowerShell session support PSReadLine? I'm assuming Windows PowerShell -- if so, it might be worth installing PowerShell Core to see if its PSReadLine works for you.
  • What's your keyboard configuration? Is it US or something else? Normal layout or something like Dvorak or Colemak?
  • What's your language/culture set to? en_US, or something else?

Tagging @SeeminglyScience as well, since he knows much more about PSReadLine than me

Ah yeah. That's most likely the known issue with different keyboard layouts.

~Here's the PR to follow lzybkr/PSReadLine#771~

The fix has already been merged (Thank you @lzybkr!)

@sba923 here's the latest preview build for PSReadLine if you'd like to see if that fixes your issue.

@rjmholt We should consider updating the insiders build to pull a daily until that fix gets into a beta

@SeeminglyScience - wrong PR, the fix was merged in https://github.com/lzybkr/PSReadLine/pull/768

Here's my setup:

  • French Windows 10 (preinstalled by Acer)
  • English and German language packs installed
  • Windows display language set to English
  • keyboard layout = French
  • Get-Culture returns
LCID             Name             DisplayName
----             ----             -----------
1033             en-US            English (United States)

If I switch VScode to PowerShell Core 6.1, the problem is still present.

If I switch the keyboard layout to English while the PowerShell "integrated terminal" starts, the problem disappears -- even if I later change the keyboard layout back to French.

HTH

@sba923 - note that some key bindings won't work correctly if you switch keyboard layouts after starting PowerShell - specifically the need for Shift differs between the initial and changed keyboard layouts, e.g. Alt+1 does not require Shift in English, but does for French.

I don't think this affects commonly used key bindings, but it's good to be aware of. If it does affect important bindings, I'd like the hear about it because I rely on a Win32 api that reports incorrect information after the keyboard layout change and the team needs customer feedback to justify fixing it.

@sba923 sorry by "swtich to PSCore", I meant as the standalone app rather than in VSCode. But I think we are using an even newer version of PSReadLine than PSCore anyway.

Anyway, it looks like this is fixed in PSReadLine.

@SeeminglyScience maybe we can come up with a way to identify PSReadLine issues similar to how PSReadLine itself deals with them to make crashing and reporting easier? Just thinking about being more helpful to @lzybkr here :)

@rjmholt I'm using PowerShell Core 6.1 next to Windows PowerShell 5.1, and don't have any prompt issues in either. Only the integrated terminal in VScode with any post-1.9.0-test-build of the PowerShell extension exhibits the problem.

@lzybkr I find it very strange that 1) there are apps that still do their keycode-to-action-or-character mapping on their own instead of relying on OS infrastructure for that 2) changing the keyboard mapping e.g. with Win+Space while an app is running (which is just... always the case) would cause problems

Where does this all tell about us getting a version of the PowerShell extension for VScode that "just works"? Do you guys have to wait for a fixed PSReadLine to be "baked into" the extension?

@sba923

Where does this all tell about us getting a version of the PowerShell extension for VScode that "just works"? Do you guys have to wait for a fixed PSReadLine to be "baked into" the extension?

Yeah this issue was just recently discovered and fixed in PSReadLine, so it hasn't made it to a beta release yet. Once that happens we can change the CI build to pull the newest release and it will be a part of the daily build bundle.

@rjmholt

@SeeminglyScience maybe we can come up with a way to identify PSReadLine issues similar to how PSReadLine itself deals with them to make crashing and reporting easier? Just thinking about being more helpful to @lzybkr here :)

Yeah we need to handle this better, even though a similar situation is unlikely to happen again. Because PSRL is invoked via PowerShellContext.ExecuteCommand any exceptions are caught, logged, optionally printed to the console, then ignored. If PSRL throws any exception, we should either fall back to old ReadLine or hard fail. Maybe in this case we should log stack trace, OS, framework, and module information into one entry for to make it a little easier to troubleshoot as well.

Great! I'll hold my breath then ;-)

Can you explain why the PowerShell Core 6.1 based Integrated Terminal in VScode is affected by the issue, whereas pwsh.exe isn't?

@sba923 I was about to give you an explanation that pwsh.exe has a lower version of PSReadLine, but it turns out it's also on beta3. According to @SteveL-MSFT this issue should be occurring in pwsh.exe 6.1.0 as well, unless you have a lower version of PSReadLine (like 1.2) overriding it somewhere.

Anyway, it will be fixed in the next PSReadLine release.

@rjmholt Here's what PSReadLine's I have on my system:

  • on disk:
ProductVersion   FileVersion      FileName
--------------   -----------      --------
10.0.17763.1     10.0.17763.1     C:\Program Files\WindowsPowerShell\Modules\PSReadline\2.0.0\Microsoft.PowerShell.PSReadline.dll
10.0.17763.1     10.0.17763.1     C:\Windows\WinSxS\msil_microsoft.powershell.psreadline_31bf3856ad364e35_10.0.17763.1_none_614e177b40342144\Microsoft.PowerShell.PSReadline.dll
2.0.0-beta3      2.0.0            C:\Program Files\PowerShell\6\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine2.dll
2.0.0-beta3      2.0.0            C:\Users\steph\.vscode\extensions\ms-vscode.powershell-2.0.0-insiders-834\modules\PSReadLine\2.0.0\Microsoft.PowerShell.PSReadLine2.dll

  • as modules in pwsh 6.1
PS C:/Users/steph> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.1.0
PSEdition                      Core
GitCommitId                    6.1.0
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0


PS C:/Users/steph> $env:PSModulePath -split ';' | % { ls -dir -filter PSReadline $_ -erroraction ignore } | % { ls -filter *.dll $_.FullName } | % { $_.VersionInfo }

ProductVersion   FileVersion      FileName
--------------   -----------      --------
2.0.0-beta3      2.0.0            C:\program files\powershell\6\Modules\PSReadLine\Microsoft.PowerShell.PSReadLine2.dll
  • as modules in Windows PowerShell 5.1 (console host, FWIW, I expect ISE to use the same)
PS C:/Users/steph> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.17763.1
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.1
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1


PS C:/Users/steph> $env:PSModulePath -split ';' | % { ls -dir -filter PSReadline $_ -erroraction ignore } | % { ls -filter *.dll $_.FullName } | % { $_.VersionInfo }
<no output>

Just noticed that at my PS6 prompt I don't get syntax coloring, whereas it works in PS5.1 -- both with PSReadline 2.0.0-beta3. What's up, doc?

We'll have an official preview release this week that will be installable from the extension marketplace.

@sba923 Is it PS6.0? If so try updating to 6.1

I'm running 6.1.2 on all my systems

Well... I must've done something... now even in Windows PowerShell 5.1 I don't get syntax coloring anymore either...

How do I repair that?

(I know, that's somewhat off-topic, but linked to experimenting with versions of PSReadLine in relationship to the present issue...)

      We'll have an official preview release this week that will be installable from the extension marketplace.

I hate to say, but the endless loop is still there with that preview...

I've also encountered the endless prompt loop.

Where do we go from here?

What could I do to help fix that?

IMVHO this is a showstopper for version 2.0 of the PowerShell extension for VScode. How can I help getting this resolved?

It is a showstopper for v2.0. We just haven't had a chance to look at the issue yet. I promise we'll address it before release of 2.0!

What would help is providing any information as to what you're doing when the endless loop occurs

Is there anything I can do to help? What would be the setup and tools required to debug this?

I think just use the Preview build, and when you hit the endless loop, let us know (in as much detail as possible) what you were doing when you hit it.

@TylerLeonhardt I have the same problem (endless loop) on my setup :

  • VS Code PowerShell Preview
  • PSReadline 2.0.0 beta 3
  • French Keyboard

My Workaround at the moment is to :

  • change keyboard layout to US (from system tray)
  • launch VS Code
  • change keyboard layout to FR

I try to update to :

  • last CI VSCode-PowerShell
  • last CI PSReadLine

The problem is still here.

It happened to me this morning just after restarting vscode insiders to install ~the latest~ yesterday's insiders. It happens so seldom that I often don't notice it for a bit and then just hit the trash can and relaunch the extension with no problem :shrug:

I think just use the Preview build, and when you hit the endless loop, let us know (in as much detail as possible) what you were doing when you hit it.

Well... I'm not doing anything special ;-)

But to be more specific here are steps guaranteed to end up with the endless loop (when the preview of the extension is enabled, of course):

  1. Start VSCode with no folder or file opened
  2. Open a folder with at least one PowerShell script in it
  3. Open the PowerShell script
  4. at this point, the TERMINAL pane shows my PowerShell profile script executing, which ends up with a prompt being displayed... in an endless loop.

I confirm that @fmichaleczek's workaround works.

How can we help further?

Important note about the workaround: every time you switch to another workspace, or do anything where the TERMINAL starts a new PowerShell instance, you have to switch to the US keyboard layout and then back to the French layout.

@sba923 Yes, it's annoying.

The problem is localized after the profile processing script ... so i made a small helper :

Microsoft.VSCode_profile.ps1

$languageToInvert = "fr-FR", "en-US"
$waitInMs = 1500
Set-WinUserLanguageList -LanguageList $LanguageToInvert[1], $LanguageToInvert[0] -Force 
$timer = [System.Timers.Timer]@{ Interval = $waitInMs }
Register-ObjectEvent -InputObject $Timer -EventName Elapsed -SourceIdentifier Timer -Action {
    Set-WinUserLanguageList -LanguageList $LanguageToInvert[0], $LanguageToInvert[1] -Force
    $timer.Stop() ; Unregister-Event Timer ; Remove-Variable languageToInvert, waitSec, timer
} > $null
$timer.Start()

Does this also work if the "VScode PowerShell host" is restarted e.g. after each debugging session?

Yes, the profile script is launched each time the extension is loaded or reloaded. I added an event timer to switch back keyboard to french after some milliseconds.

This works like a charm, thx a zillion.

Of course, that doesn't remove my offer to help with fixing the issue!

Hi all, I have some (potentially) good news. This seems to be an issue in PSReadLine itself and it will be fixed in this PR:

https://github.com/lzybkr/PSReadLine/pull/831

Once that's in, we wait for a release of PSRL, and then we can bundle that with the extension.

IIRC we've known for some time that the issue is in PSRL. Glad that they are tackling it at last.

About the workaround: beware that @fmichaleczek's code assumes that you only have two languages configurations installed:

  1. French input with French keyboard
  2. US English input with US keyboard

and that #1 is your default.

Running the code "as is" will have the (naughty) side effect of overwriting your language configuration with the one above, and of setting the Windows display language to French.

I've come up with an improved version that doesn't have this drawback:

$originallanglist = Get-WinUserLanguageList $templanglist = "en-US", "fr-FR" $waitInMs = 1500 Set-WinUserLanguageList -LanguageList $templanglist -Force $timer = [System.Timers.Timer]@{ Interval = $waitInMs } Register-ObjectEvent -InputObject $Timer -EventName Elapsed -SourceIdentifier Timer -Action { Set-WinUserLanguageList -LanguageList $originallanglist -Force $timer.Stop() ; Unregister-Event Timer ; Remove-Variable templanglist, waitSec, timer, originallanglist } > $null $timer.Start()

It has another annoyance, though: when it runs, the active keyboard layout is set to "US" (QWERTY). I need to look for a way to get (save) / set (restore) the active keyboard layout.

For now I'm going for the following code that, while it doesn't preserve the initial selected input language and the initial selected keyboard layout, does leave the system in a situation where the selected keyboard layout is French, i.e. what I need ;-)

````

preserve the original language list

this does NOT preserve the active input language or active keyboard layout

$originallanglist = Get-WinUserLanguageList

$templanglistUS = "en-US"
$templanglistFR = "fr-FR"
$waitInMs = 1500

set a temporary language list starting with the US keyboard layout

Set-WinUserLanguageList -LanguageList $templanglistUS -Force

after some delay, restore the original language list

$timer = [System.Timers.Timer]@{ Interval = $waitInMs }
Register-ObjectEvent -InputObject $Timer -EventName Elapsed -SourceIdentifier Timer -Action {
# set a temporary language list starting with the FR keyboard layout
Set-WinUserLanguageList -LanguageList $templanglistFR -Force
# restore the original language list
Set-WinUserLanguageList -LanguageList $originallanglist -Force
Write-Host("Final language list:")
$currentlanglist = Get-WinUserLanguageList
$timer.Stop() ; Unregister-Event Timer ; Remove-Variable templanglistFR, waitSec, timer, originallanglist, currentlanglist, templanglistUS
} > $null
$timer.Start()
````

I just ran into this issue as well. Sounds like the root cause was already identified but if anyone needs info let me know. I'm on a Mac using pwsh v6.2.0 preview4 w/ the powershell preview extension.

@rfoust the issue described is permanent after installing 2.0, around French keyboard and Windows.
Could you explain more your problem ?

@fmichaleczek Oh, I'm not using a French keyboard. I was playing with the debugger in vscode, and when I stopped the debugger, the integrated powershell window just started looping over and over at the prompt. It was like it couldn't exit the debugger or something and kept printing the debugger help, like when you just type ? at the prompt and it shows you the available commands. The prompt still showed the [DBG] on the prompt.

I've been trying to reproduce it but haven't been able to so far. Although this last time when I stopped the debugger, pwsh crashed and vscode said: "The PowerShell session has terminated due to an error, would you like to restart it?" I think it showed a stack trace but it disappeared.

@TylerLeonhardt What do you prefer ? A global issue about endless loop or a dedicated for each different case ?

In my opinion, @rfoust has a different issue, so it must be another item.

Maybe @sba923 should edit this issue's title to be more precised (keyboard layout) and to exclude race condition.

Maybe… is that OK / "good practice"?

Hi everyone! If you can, please try out this version of PSReadLine:
PSReadLine.zip

To be sure you're using that version, I recommend:

  • Unblock the files
  • make sure it's the ONLY PSRL available on the PSES module path ($env:PSModulePath)
  • run gmo PSReadLine | % { $_.PrivateData.PSData } and make sure it says beta4

Please let me know if this fixes the issue or if you need any assistance getting beta4. Keep in mind, this is not a signed version of PSRL and should only be used for testing this bug fix.

cc @SteveL-MSFT @rjmholt

Trying this (PSRL beta4) on a dev build of latest master (both vscode-powershell & pses):

2019-03-22 23:49:09.476 [VERBOSE] tid:25 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.549 [ERROR] tid:20 in 'OnListenTaskCompleted' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs: line 391
    ProtocolEndpoint message loop terminated due to unhandled exception:

    System.AggregateException: One or more errors occurred. (Object reference not set to an instance of an object.) ---> System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 768
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 813
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, Boolean sendOutputToHost, Boolean sendErrorToHost) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 450
       at Microsoft.PowerShell.EditorServices.CommandHelpers.GetCommandInfoAsync(String commandName, PowerShellContext powerShellContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\CommandHelpers.cs:line 60
       at Microsoft.PowerShell.EditorServices.SymbolDetails.CreateAsync(SymbolReference symbolReference, PowerShellContext powerShellContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\SymbolDetails.cs:line 51
       at Microsoft.PowerShell.EditorServices.LanguageService.FindSymbolDetailsAtLocationAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\LanguageService.cs:line 271
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleHoverRequestAsync(TextDocumentPositionParams textDocumentPositionParams, RequestContext`1 requestContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs:line 954
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessageAsync(Message messageToDispatch, MessageWriter messageWriter) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs:line 160
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessagesAsync(CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs:line 379
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\AsyncContext.cs:line 49
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContextThread.<>c__DisplayClass4_0.<Run>b__0() in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\AsyncContextThread.cs:line 66
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
       --- End of inner exception stack trace ---
    ---> (Inner Exception #0) System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 768
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 813
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, Boolean sendOutputToHost, Boolean sendErrorToHost) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 450
       at Microsoft.PowerShell.EditorServices.CommandHelpers.GetCommandInfoAsync(String commandName, PowerShellContext powerShellContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\CommandHelpers.cs:line 60
       at Microsoft.PowerShell.EditorServices.SymbolDetails.CreateAsync(SymbolReference symbolReference, PowerShellContext powerShellContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\SymbolDetails.cs:line 51
       at Microsoft.PowerShell.EditorServices.LanguageService.FindSymbolDetailsAtLocationAsync(ScriptFile scriptFile, Int32 lineNumber, Int32 columnNumber) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Language\LanguageService.cs:line 271
       at Microsoft.PowerShell.EditorServices.Protocol.Server.LanguageServer.HandleHoverRequestAsync(TextDocumentPositionParams textDocumentPositionParams, RequestContext`1 requestContext) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\Server\LanguageServer.cs:line 954
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.MessageDispatcher.DispatchMessageAsync(Message messageToDispatch, MessageWriter messageWriter) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\MessageDispatcher.cs:line 160
       at Microsoft.PowerShell.EditorServices.Protocol.MessageProtocol.ProtocolEndpoint.ListenForMessagesAsync(CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Protocol\MessageProtocol\ProtocolEndpoint.cs:line 379
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContext.Start(Func`1 asyncMainFunc, ILogger logger) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\AsyncContext.cs:line 49
       at Microsoft.PowerShell.EditorServices.Utility.AsyncContextThread.<>c__DisplayClass4_0.<Run>b__0() in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\AsyncContextThread.cs:line 66
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
    --- End of stack trace from previous location where exception was thrown ---
       at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)<---


2019-03-22 23:49:09.549 [ERROR] tid:20 in 'ProtocolEndpoint_UnhandledException' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices.Host\EditorServicesHost.cs: line 490
    PowerShell Editor Services is terminating due to an unhandled exception, see previous logs for details.

2019-03-22 23:49:09.626 [VERBOSE] tid:4 in 'ExecuteCommandAsync' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 724
    Execution completed successfully.

2019-03-22 23:49:09.626 [VERBOSE] tid:4 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.626 [VERBOSE] tid:4 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.626 [VERBOSE] tid:4 in 'ExecuteCommandAsync' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 648
    Attempting to execute command(s):

        prompt


2019-03-22 23:49:09.627 [VERBOSE] tid:4 in 'OnSessionStateChanged' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 1684
    Session state changed --

        Old state: Ready
        New state: Running
        Result: NotFinished

2019-03-22 23:49:09.656 [ERROR] tid:1 in 'PopRunspace' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 2477
    Caller attempted to pop a runspace when no runspaces are on the stack.

2019-03-22 23:49:09.656 [VERBOSE] tid:1 in 'OnSessionStateChanged' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 1684
    Session state changed --

        Old state: Running
        New state: Aborting
        Result: NotFinished

2019-03-22 23:49:09.665 [VERBOSE] tid:4 in 'OnSessionStateChanged' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 1684
    Session state changed --

        Old state: Aborting
        New state: Ready
        Result: Aborted

2019-03-22 23:49:09.665 [ERROR] tid:4 in 'ExecuteCommandAsync' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 718
    Execution of the following command(s) completed with errors:

        prompt



2019-03-22 23:49:09.665 [VERBOSE] tid:4 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.665 [ERROR] tid:1 in 'PopRunspace' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs: line 2477
    Caller attempted to pop a runspace when no runspaces are on the stack.

2019-03-22 23:49:09.667 [VERBOSE] tid:4 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.667 [VERBOSE] tid:4 in 'Post' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Utility\ThreadSynchronizationContext.cs: line 64
    Attempted to post message to synchronization context after it's already completed

2019-03-22 23:49:09.681 [ERROR] tid:4 in 'StartReplLoopAsync' C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\Host\EditorServicesPSHostUserInterface.cs: line 849
    Exception: Caught exception while reading command line

    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 768
       at Microsoft.PowerShell.EditorServices.PowerShellContext.ExecuteCommandAsync[TResult](PSCommand psCommand, StringBuilder errorMessages, ExecutionOptions executionOptions) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 813
       at Microsoft.PowerShell.EditorServices.Session.PSReadLinePromptContext.InvokeReadLineAsync(Boolean isCommandLine, CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PSReadLinePromptContext.cs:line 134
       at Microsoft.PowerShell.EditorServices.PowerShellContext.InvokeReadLineAsync(Boolean isCommandLine, CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\PowerShellContext.cs:line 1047
       at Microsoft.PowerShell.EditorServices.Console.ConsoleReadLine.ReadLineAsync(Boolean isCommandLine, CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Console\ConsoleReadLine.cs:line 137
       at Microsoft.PowerShell.EditorServices.EditorServicesPSHostUserInterface.StartReplLoopAsync(CancellationToken cancellationToken) in C:\Users\Keith\GitHub\rkeithhill\PowerShellEditorServices\src\PowerShellEditorServices\Session\Host\EditorServicesPSHostUserInterface.cs:line 827

@rkeithhill were you able to get it to start up at all? I can't seem to repro. Double check you've unblocked all of the files

Yes, I got it to work but I had to comment out some of my PSRL settings in my profile

Not sure if this is related or not, but if I'm debugging and at a breakpoint, and stop the debugging, I get this repeated over and over in a loop. It's nice the error was formatted in markup. :)

Exception

System.Management.Automation.Runspaces.InvalidRunspaceStateException: Cannot invoke the pipeline because the runspace is not in the Opened state. Current state of the runspace is 'Closing'.
   at System.Management.Automation.Runspaces.RunspaceBase.AddToRunningPipelineList(PipelineBase pipeline)
   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.Runspaces.Pipeline.Invoke()
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   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.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

P> @
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new

Environment

PSReadLine: 2.0.0-beta3
PowerShell: 2.0.0
OS: Darwin 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64
Last 200 Keys

 o r t - d u Backspace Backspace m o d u l e Spacebar d u a c c o u n t m a n a g e m e n t Spacebar - f o r c e Enter
 UpArrow UpArrow UpArrow UpArrow Enter
 UpArrow UpArrow Enter
 UpArrow UpArrow Enter
 $ t Enter
 $ t . t e n Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace Backspace i m p o r t m Backspace - m o d u l e Spacebar d u a c c o u n t n a Backspace Backspace m a n a t e m e n g Backspace Backspace Backspace Backspace Backspace Backspace g e m e n t Spacebar - f o r c e Enter
 g e t - d u u s e r Tab Spacebar r f o u s t Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 c Enter
 Ctrl+c @

Exception

System.Management.Automation.Runspaces.InvalidRunspaceStateException: Cannot invoke the pipeline because the runspace is not in the Opened state. Current state of the runspace is 'Closing'.
   at System.Management.Automation.Runspaces.RunspaceBase.AddToRunningPipelineList(PipelineBase pipeline)
   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.Runspaces.Pipeline.Invoke()
   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
   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.CoreInvoke[TOutput](IEnumerable input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadKey()
   at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
   at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics, CancellationToken cancellationToken)

P> @

@sba923 and @fmichaleczek were you guys able to try with the PSReadLine @TylerLeonhardt commented

Not yet, and I must confess I was kinda scared by the first testing reports...

@rfoust would you mind opening that as a separate issue? Thanks!

Not yet, and I must confess I was kinda scared by the first testing reports...

The behaviour's probably going to be better than an infinite loop. There were changes made in the most recent update for international keyboards. But the only way we can improve it is by trying it out.

I've replaced PSRL beta3 with beta4, made it so that @fmichaleczek's workaround is nop-ed out using:

````
Write-Host ("{0:yyyy-MM-dd HH:mm:ss.fff}: '{1}' starting..." -f (Get-Date), $MyInvocation.MyCommand.Path)

$psrl = (Get-Module PSReadLine)

if ($null -eq $psrl)
{
$prerelease = $null
Write-Host -ForegroundColor Red ("Cannot find PSReadLine!!!")
}
else
{
Write-Host("PSReadLine is '{0}'" -f $psrl.Path)
$prerelease = ($psrl | ForEach-Object { $_.PrivateData.PSData })['Prerelease']
}

if ($prerelease -eq 'beta4')
{
Write-Host("No workaround should be needed for PSReadLine 2.0.0 beta4")
}
else
{
…
}
````

and it seems to work (just did one quick test):

2019-03-29 15:57:11.528: 'C:\private_sba\profile.ps1' exiting. 2019-03-29 15:57:14.411: 'C:\private_sba\NET\DOC\WindowsPowerShell\Microsoft.VSCode_profile.ps1' starting... PSReadLine is 'C:\Users\sba\.vscode\extensions\ms-vscode.powershell-preview-2.0.0\modules\PSReadLine\2.0.0\PSReadLine.psm1' No workaround should be needed for PSReadLine 2.0.0 beta4

no endless loop at this point!

I'll deploy this on as many systems as possible and report back.

FWIW here's how I checked that I have only copies of PSReadLine beta4 on $env:PSModulePath:

$env:PSModulePath -split ';' | ForEach-Object { $psrlpath = Join-Path -Path $_ -ChildPath 'PSReadLine' $found = Test-Path -LiteralPath $psrlpath $prerelease = $null if ($found) { $isprerelease = $false $psrl = Get-Module -ListAvailable -FullyQualifiedName $psrlpath if ($null -ne $psrl) { $version = $psrl.Version $privatedata = $psrl.PrivateData if ($null -ne $privatedata) { $prerelease = $privatedata['PSData']['Prerelease'] $isprerelease = $true } } [PSCustomObject]@{ Path = $psrlpath Found = $found Version = $version IsPrerelease = $isprerelease Prerelease = $prerelease } } }

On one system I'm facing something pretty weird: during execution of Microsoft.VSCode_profile.ps1, and at the TERMINAL prompt, "get-module PSReadLine" returns $null, even though the module is found on $env:PSModulePath.

There must be something I don't understand / guess about the inner workings of PSES / the extension.

Can someone help me out with this?

Same problem on another machine...

Does this give a hint on what's going on?

PS ~/powershell> gmo psreadline PS ~/powershell> import-module -verbose psreadline VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\psreadline.psd1'. VERBOSE: Cannot verify the Microsoft .NET Framework version 4.6.1 because it is not included in the list of permitted versions. VERBOSE: Loading 'FormatsToProcess' from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\PSReadLine.format.ps1xml'. VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\Microsoft.PowerShell.PSReadLine2.dll'. VERBOSE: Importing cmdlet 'Get-PSReadLineOption'. VERBOSE: Importing cmdlet 'Set-PSReadLineOption'. VERBOSE: Importing cmdlet 'Set-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Get-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Remove-PSReadLineKeyHandler'. VERBOSE: Loading module from path 'C:\Users\steph\OneDrive\Documents\WindowsPowerShell\Modules\psreadline\2.0.0\PSReadLine.psm1'. VERBOSE: Exporting function 'PSConsoleHostReadLine'. VERBOSE: Exporting cmdlet 'Get-PSReadLineOption'. VERBOSE: Exporting cmdlet 'Set-PSReadLineOption'. VERBOSE: Exporting cmdlet 'Set-PSReadLineKeyHandler'. VERBOSE: Exporting cmdlet 'Get-PSReadLineKeyHandler'. VERBOSE: Exporting cmdlet 'Remove-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Get-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Get-PSReadLineOption'. VERBOSE: Importing cmdlet 'Remove-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Set-PSReadLineKeyHandler'. VERBOSE: Importing cmdlet 'Set-PSReadLineOption'. VERBOSE: Importing function 'PSConsoleHostReadLine'.

@SydneyhSmith @TylerLeonhardt I tested beta4 (On preview 2) on 2 PCs and it looks like it working.
With beta3 if keyboard is on Hebrew and I start the terminal I get the loop, with beta4 I don't have this problem.
Thank you

@sba923 Get-Module PSReadLine means that PSRL is not loaded in your session. However, if you run Set-PSReadLineKeyHandler or something in your profile, that will cause module autoloading to load PSRL.

We probably load PSRL after profiles are run, but if your profile runs a cmdlet from PSRL, it will cause it to load PSRL and all will be fine.

We can close this issue now as being an external issue fixed in the next release of PSRL but @sba923 if you have more concerns regarding when PSRL gets loaded, feel free to open a new issue.

Thanks to all who contributed to this fix! ISE's grave is getting deeper ;-)

@TylerLeonhardt Yes I will open another issue for the problem where PSRL doesn't get loaded in some circumstances: when this happens not only don't I get PSRL in my VScode session, but also if I load it manually using Import-Module it doesn't behave properly (no syntax highlighting, so history backed by a file on disk....)

Opened #1834

@sba923 That link in your comment is broken (leads to: https://github.com/PowerShell/vscode-powershell/issues/url)

Fixed, thanks for the remark.

Was this page helpful?
0 / 5 - 0 ratings