PSReadline is not supported in the integrated console at this time. A non-trivial amount of work is needed to make PowerShell Editor Services and PSReadline play nicely together so this could take some time.
Features this will enable:
i was going to request this yesterday but i got distracted.
Thank you!
Hopefully this will include PSReadline's Vi EditMode and ViModeIndicator. I found this issue while searching for a way to get vi mode working.
Um, @daviwil, when did PSReadline start working in the VSCode PowerShell terminal window? I just opened the terminal and noticed my PSReadline history was available. A quick Set-PSReadlineOption -EditMode Vi and I'm in hog heaven!
Is there something I should be watching for? I guess I should mention: Windows 10 Anniversary Update, PowerShell 5.1, VSCode 1.13.1, PowerShell addin 1.4.1...
PSReadline support in the PowerShell terminal is a VSCode feature. What isn't implemented yet is PSReadline support in the PowerShell Integrated Console.
Hey Greg, unfortunately you're just seeing PSReadLine work inside of plain powershell.exe in the integrated terminal. As Keith mentions, it doesn't currently work in the PowerShell Integrated Console yet. I've started working on that last week though so I expect to have some progress soon!
Thanks @daviwil and @rkeithhill! I guess I need to start playing with the Integrated Console because I'm sure I knew it was there. It will be great to have PSReadline support because that one particular feature is why I abandoned the ISE a long time ago. I'm such a lousy typist I need all the help I can get. ;-)
@daviwil any update on this killer feature? ;)
Will this also make it so Clear-Host actually clears the terminal window and doesn't just move the input line to the top of the screen?
Hi!! @daviwil,
Any update on this enhancement ?
It sure is one of the few things that keeps me going back to ISE or the powershell console from time to time.
On a sidenote... I really hope this great project is not put on hold.. cause it seems that there's less and less activity in the repo.
Thanks for all the work!
@djobin agree, see #31555
Just adding a 'me too'.
As far as I can tell, this is the feature needed to allow for shelving of ISE for VScode. I love the GIT integration in VScode, but the crippled debug is a show stopper.
I'm guessing that the PSReadLine support may fix the $host.PrivateData issue also? (it contains terminal color values, just not in the integrated console)
It's coming. Still some kinks left, but it's coming.

I'm guessing that the PSReadLine support may fix the $host.PrivateData issue also? (it contains terminal color values, just not in the integrated console)
Definitely not related. I didn't get a chance to look at it this weekend but we'll get it fixed for sure :)
omg that looks awesome @SeeminglyScience, I'm so pumped 🎉
Looks great @SeeminglyScience! I'm ready to ditch ISE :)
Found this while trying to get syntax highlighting working in the integrated console. I look forward to this being available! Great work!
@SeeminglyScience Any ETA for seeing this in Insiders? This is the final piece to having a comfortable single pane workflow and not need to set up a side-by-side ConEmu instance.
Thanks for the work!
@Liquidmantis I'm thinking I can get a solid build of it behind a feature flag not next release but the one after. No promises as I'm a little short on free time atm, but that's the goal :)
@SeeminglyScience that's great to hear! can't wait to finally have PSReadline support, thanks
I got it working, all you do is import the module ;) Read the install instructions for PowerShellGallery, it's fairly straightforward.
@darkquake93 if you just import the standard PSReadline module into the PS extension's Integrated Console, it will break all language and debugging functionality. @SeeminglyScience's work is to enable PSReadline to coexist with the PowerShell extension's language capabilities.
Oh I didn't realise. I only use Powershell for minimal use on my home Windows 7 machine, and all seems good for the time being with syntax highlighting and ctrl+delete etc working. I'll keep that in mind though, but my computer at work is already on Windows 10 so that's probably where I'll do debugging in the future, I just like to run simple scripts at home :)
When o When will this be there?
https://www.youtube.com/watch?v=39S3dLDEbYs :-)
You're welcome to try installing the module anyway like I did, I found it was good enough.
@darkquake93 It sounds like you are talking about getting PSReadLine to work in Windows 7, this discussion is for getting PSReadLine to work within the console created by this extension in VSCode. We explicitly remove the module at start up because it breaks all editor features, just installing the module wouldn't make a difference in this case.
Oh sorry, you're right. Thanks for the explanation anyway.
Any update on when this will be available?
Any news about this feature?
@SeeminglyScience is working really hard on this. We had a demo at the MVP Summit in March but it still has a few bugs he is figuring out. It's a substantial change to PowerShell Editor Services.
:shipit:
Not sure if it's the same core problem, but when hitting F8 on a line of code, focus changes to the integrated console instead of the code, which is different from powershell_ise behavior. I prefer the powershell_ise behavior, not sure how many others do. (Answered below by tylerl0706 - thx)
@uttampcu you're going to want to set the powershell.integratedConsole.focusConsoleOnExecute setting. That will do what you want. It behaves the way it does in order to be accessible.
Any workarounds available for Issue #535 while we wait? Can we get @SeeminglyScience 's pre-release code to reduce the pain?
Is inability to press arrow up/down to go previous/last command issued during debugging is part of this issue?
@artisticcheese that will also be fixed with PSReadLine
Looking forward to this update also!
I believe our integration with PSReadLine depends on a PSReadLine 2 API, which is incompatible with PowerShell versions below v5. So before we can bring PSReadLine in, we will need to resolve our support story for PowerShell v4 and below.
Please see here: https://github.com/PowerShell/vscode-powershell/issues/1310
To me, this sounds like this will last a long time before we get this available.
I opened an issue back in August 2017 (https://github.com/PowerShell/vscode-powershell/issues/975 ) mentionning the fact that history and up and down arrow keys don't work. I got told it would be fixed with the introduction of PSreadLine.
As matter a fact, according to https://github.com/PowerShell/vscode-powershell/issues/1310 mentionned above, you want to drop the support for powershell v3, v4. Which means that the original issue (that a lot of people seem to be asking for) won't be fixed when working on scripts on older versions of powershell.
To me, this is a crucial functionality for any IDE, which really enhance the user experience. I think everybody has waited pretty long for this fix. This drives me nuts sometimes, and I was actually really looking forward to it.
@Stephanevg I understand your frustration but that issue in particular is more complicated than it probably appears. I looked into this awhile ago and the fix is actually pretty easy, but it's currently hiding a bigger issue.
Right now when you run a command through the debugger there is no way to suppress it from history. This includes all of the commands we run in the background to get variables, the call stack, intellisense, everything. A lot of those commands get invoked every single time a command is ran from the prompt and/or every time the debugger steps. So currently, if you could navigate history, you'd be looking at mostly the background commands.
Keep in mind this is a PowerShell API, so the older versions are pretty much set in stone. Usually we can find some sort of workaround to kind of fake the same functionality, but this one is pretty solidly hard coded in.
PSReadLine solves this in a way because it has it's own history management system. But getting that working with the other editor features requires changes to PSReadLine. Older versions of PSReadLine support PSv3/4 but the newest one (the one we have to add these changes to) does not.
All that said remember you can still write scripts targeting v3/4, you only need PSv5.1 installed on your dev machine. For example, if you are currently writing scripts that target PSv2 then nothing will change because we already don't support that version.
Getting closer! https://github.com/PowerShell/PowerShellEditorServices/pull/672
It looks like that PR has been merged into 2.0.0 - What is left to get it working with this extension in insiders? Is there anything that could use love to get this closer to reality?
@BatmanAMA @rjmholt is working on migrating PowerShell Editor Services to .NET Standard 2.0 and PowerShell Standard.
https://github.com/PowerShell/PowerShellEditorServices/pull/741
Here's a build from that latest PR (which is pretty much complete) with the PSReadLine features enabled:
psvsix.zip
(GitHub won't let me upload a VSIX directly, but just expand the zip and it will be in there)
To install:
code --install-extension ./PowerShell-v2-insiders.vsix
Or if you use VSCode Insiders:
code-insiders --install-extension ./PowerShell-v2-insiders.vsix
Then you will need to enable the feature in your VSCode user settings by adding to the feature flags:
{
"powershell.developer.featureFlags": [
"PSReadLine"
]
}
There are still come trickier bugs, mainly on *nix.
If you're interested in the source, the backend can be built from this branch (I made a new one where the PSRL import is hardcoded, since the newest PowerShell Core overrides our PSRL with one that has the same version but is older -- we're waiting on the next PSRL release to fix that). The frontend is based on this branch (which is just the normal frontend with the versions changed to make installation nicer), but needs these lines removed.
Anyway, give it a try and let us know how it goes.
Right after having the new version installed, debugging was no longer possible:
Cannot debug or run a PowerShell script until the PowerShell session has started. Wait for the PowerShell session to finish starting and try again.
After some time, I get this error:
The language service could not be started:
The log shows:
9/6/2018 1:29:01 PM [NORMAL] - Visual Studio Code v1.26.1 64-bit
9/6/2018 1:29:01 PM [NORMAL] - PowerShell Extension v2.0.0
9/6/2018 1:29:01 PM [NORMAL] - Operating System: Windows 64-bit
9/6/2018 1:29:01 PM [NORMAL] - Path specified by 'powerShellExePath' setting - '' - not found, reverting to default PowerShell path.
9/6/2018 1:29:01 PM [NORMAL] - Language server starting --
9/6/2018 1:29:01 PM [NORMAL] - exe: C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
9/6/2018 1:29:01 PM [NORMAL] - args: C:\Users\randr\.vscode\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2.0.0'-AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\randr\.vscode\extensions\ms-vscode.powershell-2.0.0\modules'-EnableConsoleRepl -LogLevel 'Normal' -LogPath 'C:\Users\randr\.vscode\extensions\ms-vscode.powershell-2.0.0\logs\1536233341-15e829a8-2222-4bfd-8dd7-003ff46574671536233335047\EditorServices.log' -SessionDetailsPath 'C:\Users\randr\.vscode\extensions\ms-vscode.powershell-2.0.0\sessions\PSES-VSCode-19296-915042' -FeatureFlags @('PSReadLine')
9/6/2018 1:29:01 PM [NORMAL] - Syntax Folding Provider registered
9/6/2018 1:29:02 PM [NORMAL] - powershell.exe started, pid: 5920
9/6/2018 1:31:01 PM [NORMAL] - Language server startup failed.
9/6/2018 1:31:01 PM [ERROR] - The language service could not be started:
9/6/2018 1:31:01 PM [ERROR] - Timed out waiting for session file to appear.
@raandree This is a shot in the dark, but what's the highest .NET Framework version you have installed? If it's under 4.7.1, try installing that.
@raandree I have the same issue and I have found that the Microsoft.PowerShell.EditorServices.dll library is not in the expected path when the 'Start-EditorServices.ps1' script runs.
from the PowerShellEditorServices.psm1 ::
if (!$PSVersionTable.PSEdition -or $PSVersionTable.PSEdition -eq "Desktop")
{
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorServices.dll"
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Desktop/Microsoft.PowerShell.EditorServices.Host.dll"
}
else
{
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Core/Microsoft.PowerShell.EditorServices.dll"
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Core/Microsoft.PowerShell.EditorServices.Protocol.dll"
Microsoft.PowerShell.Utility\Add-Type -Path "$PSScriptRoot/bin/Core/Microsoft.PowerShell.EditorServices.Host.dll"
}
On my system, I don't have Powershell 6 installed, only the Desktop version (5.1) and in the .\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin folder, there is only a 'Core' folder, no 'Desktop' folder.
It seems to me that this would only work with Powershell Core installed.
@rjmholt has been working on porting all of PowerShell Editor Services to .NET Standard and this seems to be a place he missed.
Windows PowerShell 5.1 will be supported.
@SeeminglyScience, thanks for the hint, but .net 4.7.2 is installed.
PS C:\> Get-DotNetFrameworkVersion
ComputerName Build Version Comment
------------ ----- ------- -------
RAANDREE1 50727 2.0.50727.4927
RAANDREE1 30729 3.0.30729.4926
RAANDREE1 30729 3.5.30729.4926
RAANDREE1 461808 4.7.2 (Windows 10 1803)
@djobin, this is it. Missing the Desktop folder as well.
When do we get a new build to play with?
@raandree Just finishing one up now (sorry, currently in an Australian timezone, so a bit out of kilter with US business hours)
FYI, I've hit a snag but working to fix it ASAP. See https://github.com/PowerShell/PowerShellEditorServices/pull/741.
Ok I've uploaded a new VSIX in the comment above (psvsix.zip).
I've made sure that this one works with Windows PowerShell, PowerShell Core 6.0 and PowerShell Core 6.1.
Give that a try 😄
Working on Mac with 6.1 for me for the most part! At least PSReadline is working well 😃 SO AWESOME
@rjmholt Fantastic thank you for this!
Btw, I should be able to link to an AppVeyor artefact soon. It's just complicated because the two repos need to be synced.
Looking forward to seeing this in the Insiders release 👍
Working for me too on MacOS with PSCore 6.1 :).
Installed it on WinServer 2012R2 with WMF 5.1 and it does not seem work in the latest version of code or insiders (i.e. I cannot use the up/down keys to get to the last command in the debugger) unless I am doing something wrong
Have you added this to your config?
"powershell.developer.featureFlags": [
"PSReadLine"
]
@raandree Yes, thanks. I forget this as I was on a new machine, sorry, it works now :-)
@rjmholt, thanks for the new version, this is a real improvement. Two things that I am missing:
Set the following PSRL handlers in your VSCode specific profile:
Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardKillWord
Set-PSReadLineKeyHandler -Chord 'Ctrl+@' -Function MenuComplete
Set-PSReadLineKeyHandler -Chord 'Alt+D' -Function KillWord
I'm assuming you're using the default Windows EditMode. If you use something else (Vi/Emacs) you may want other mappings.
Clear-Screen still does not really clear the screen
This is an issue with VSCode and not the PS extension (or the PSRL integration). See https://github.com/Microsoft/vscode/issues/30638 and https://github.com/Microsoft/vscode/issues/45693
I hate to say, but I can't get that latest test build to install...
I've uninstalled v1.9.0 of the extension, and then run:
"c:\Program Files\Microsoft VS Code\Code.exe" --install-extension d:\tmp\Powershell-v2-extremely-alpha.vsix
from a CMD prompt.
VScode starts up, but the extension isn't installed.
What am I missing?
If you try the same with a --verbose flag, that should provide more information to work with
@sba923 that exe just launches code, the CLI arguments don't work with it. Try this:
& "C:\Program Files\Microsoft VS Code\bin\code.cmd" --install-extension D:\tmp\Powershell-v2-extremely-alpha.vsix
Ah I didn't catch the .exe ending there (I remember it briefly giving me pause, but I dismissed it), nice one @SeeminglyScience!
Tada!
PS D:/tmp> & 'C:\Program Files\Microsoft VS Code\bin\Code.cmd' --install-extension .\Powershell-v2-extremely-alpha.vsix
Code.cmd : [createInstance] extensionManagementService depends on downloadService which is NOT registered.
At line:1 char:1
+ & 'C:\Program Files\Microsoft VS Code\bin\Code.cmd' --install-extensi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ([createInstance...NOT registered.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Extension 'Powershell-v2-extremely-alpha.vsix' was successfully installed!
After that, starting VScode gets me something unusable ;-(
The Terminal pane starts a PowerShell, which shows the prompt repeatedly in an endless loop, like if I was holding the Enter key down for it to autorepeat...
Ah I've seen that before at some point. I think rather than trying to debug that, hold tight for a couple of days and we should have an AppVeyor asset to point to by then
Ok, I've built a new one while doing some testing, so thought I should upload it here:
psvsix.zip
All the links above also point to this one now.
This one is rebased on all the stability and performance work done in v1.9.0. As always, let me know if there are any issues.
Thank you for the great work on this. For me, it was the only thing holding the extension back.
I've been testing for the last hour and I cannot get the Killword function to work with "Ctrl+Delete". Instead, I just get a "D" character.
Set-PSReadlineKeyHandler -Chord "Ctrl+Delete" -Function KillWord
If I change it to "Ctrl+D" it works. I've also enable the flag in my config.
Thank you again, this is fantastic.
@GaryChan1 Did you try this:
Set-PSReadLineKeyHandler -Chord 'Alt+D' -Function KillWord
See my previous comment
Perhaps someone can point me in the right direction. I am running Code Insiders
Version: 1.28.0-insider (system setup)
Commit: 85d970acdee48f6dcecf909a0faeb3c6882217a9
Date: 2018-10-02T22:27:52.997Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
Installed the vsix file with:
code-insiders --install-extension C:\Usersxxxxx\Downloads\Powershell-v2-extremely-alpha.vsix
I also put in...
{
"powershell.developer.featureFlags": [
"PSReadLine"
]
}
And opened VSCode and it thinks for a moment and then displays the following in the terminal pane:
An error occurred while starting PowerShell Editor Services:
Could not load file or assembly 'System.Security.AccessControl, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath,
ObjectHandleOnStack retAssembly)
at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Microsoft.PowerShell.Commands.AddTypeCommand.LoadAssemblies(IEnumerable`1 assemblies)
at Microsoft.PowerShell.Commands.AddTypeCommand.EndProcessing()
at System.Management.Automation.Cmdlet.DoEndProcessing()
at System.Management.Automation.CommandProcessorBase.Complete()
It then gives me the opportunity to see another log which displays this:
10/2/2018 8:29:37 PM [NORMAL] - Visual Studio Code v1.28.0-insider 64-bit
10/2/2018 8:29:37 PM [NORMAL] - PowerShell Extension v2.0.0
10/2/2018 8:29:37 PM [NORMAL] - Operating System: Windows 64-bit
10/2/2018 8:29:37 PM [NORMAL] - Language server starting --
10/2/2018 8:29:37 PM [NORMAL] - exe: C:\Program Files\PowerShell\6.0.2\pwsh.exe
10/2/2018 8:29:37 PM [NORMAL] - args: C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\Start-EditorServices.ps1 -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2.0.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules' -EnableConsoleRepl -LogLevel 'Normal' -LogPath 'C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\logs\1538530177-70a76287-30ba-4526-bb28-9041ee5121c11538530173284\EditorServices.log' -SessionDetailsPath 'C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\sessions\PSES-VSCode-10260-653975' -FeatureFlags @()
10/2/2018 8:29:37 PM [NORMAL] - Syntax Folding Provider registered
10/2/2018 8:29:40 PM [NORMAL] - powershell.exe started, pid: 4344
10/2/2018 8:31:35 PM [NORMAL] - Language server startup failed.
10/2/2018 8:31:35 PM [ERROR] - The language service could not be started:
10/2/2018 8:31:35 PM [ERROR] - Timed out waiting for session file to appear.
Also I did also try Run As Administrator on VSCode and got the same error.
I am sure it is something simple I didn't set up correctly ;-)
@scotthardwick What version of .NET do you have installed? If you don't have at least 4.7.1, give that an update and see if that fixes it
@rkeithhill That did it, thank you.
@scotthardwick can you also provide the output of:
$PSVersionTable
and
gci ~/.vscode-insiders/extensions/ms-vscode.powershell-2.0.0/modules/PowerShellEditorServices/bin/* -Recurse
@SeeminglyScience and @rjmholt I have fiddled around some more and updated from Powershell 6.0.2 to 6.1.0 and now it works! I guess I didn't realize there was a minimum required spec there. Thanks for answering, it got me poking around at versions!
Hmmmm, it ought to work with 6.0.x — I specifically tested that scenario (because it works differently to 6.1.x in terms of those Windows dependencies).
Can you provide the output of the above commands?
I have already installed 6.1 so not sure if this is still useful, but here it is!
With "powershell.powerShellExePath": "C:\Program Files\PowerShell\6\pwsh.exe",
$PSVersionTable
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 10.0.14393
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
gci ~/.vscode-insiders/extensions/ms-vscode.powershell-2.0.0/modules/PowerShellEditorServices/bin/* -Recurse
Directory: C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/2/2018 8:28 PM 6.0
d----- 10/2/2018 8:28 PM Desktop
-a---- 10/2/2018 8:28 PM 9052 libdisablekeyecho.dylib
-a---- 10/2/2018 8:28 PM 8840 libdisablekeyecho.so
-a---- 10/2/2018 8:28 PM 396800 Microsoft.PowerShell.EditorServices.dll
-a---- 10/2/2018 8:28 PM 35328 Microsoft.PowerShell.EditorServices.Host.dll
-a---- 10/2/2018 8:28 PM 8572 Microsoft.PowerShell.EditorServices.Host.pdb
-a---- 10/2/2018 8:28 PM 129100 Microsoft.PowerShell.EditorServices.pdb
-a---- 10/2/2018 8:28 PM 252416 Microsoft.PowerShell.EditorServices.Protocol.dll
-a---- 10/2/2018 8:28 PM 69612 Microsoft.PowerShell.EditorServices.Protocol.pdb
-a---- 10/2/2018 8:28 PM 639488 Newtonsoft.Json.dll
-a---- 10/2/2018 8:28 PM 118272 Serilog.dll
-a---- 10/2/2018 8:28 PM 8704 Serilog.Sinks.Async.dll
-a---- 10/2/2018 8:28 PM 31744 Serilog.Sinks.Console.dll
-a---- 10/2/2018 8:28 PM 26624 Serilog.Sinks.File.dll
-a---- 10/2/2018 8:28 PM 4096 UnixConsoleEcho.dll
Directory:
C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin\6.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/2/2018 8:28 PM 29840 System.IO.Pipes.AccessControl.dll
-a---- 10/2/2018 8:28 PM 104584 System.Security.AccessControl.dll
-a---- 10/2/2018 8:28 PM 82576 System.Security.Principal.Windows.dll
Directory:
C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/2/2018 8:28 PM 25744 System.IO.Pipes.AccessControl.dll
-a---- 10/2/2018 8:28 PM 39048 System.Security.AccessControl.dll
-a---- 10/2/2018 8:28 PM 23688 System.Security.Principal.Windows.dll
I think my work computer still has 6.0.2 on it, so I can try that tomorrow for you if it would be useful.
Hmmmm the binaries are there... And the startup script should be adding them before it can fail to resolve...
Same "endless prompt loop" with that build.
@rjmholt I went ahead and VPN'd to my work computer and it works just fine even with 6.0.2. Not sure why my home PC wasn't cooperating.
Work computer info:
"powershell.powerShellExePath": "C:\Program Files\PowerShell\6.0.2\pwsh.exe",
Name Value
---- -----
PSVersion 5.1.15063.1155
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.15063.1155
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Directory: C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 10/2/2018 11:58 PM 6.0
d----- 10/2/2018 11:58 PM Desktop
-a---- 10/2/2018 11:58 PM 9052 libdisablekeyecho.dylib
-a---- 10/2/2018 11:58 PM 8840 libdisablekeyecho.so
-a---- 10/2/2018 11:58 PM 396800 Microsoft.PowerShell.EditorServices.dll
-a---- 10/2/2018 11:58 PM 35328 Microsoft.PowerShell.EditorServices.Host.dll
-a---- 10/2/2018 11:58 PM 8572 Microsoft.PowerShell.EditorServices.Host.pdb
-a---- 10/2/2018 11:58 PM 129100 Microsoft.PowerShell.EditorServices.pdb
-a---- 10/2/2018 11:58 PM 252416 Microsoft.PowerShell.EditorServices.Protocol.dll
-a---- 10/2/2018 11:58 PM 69612 Microsoft.PowerShell.EditorServices.Protocol.pdb
-a---- 10/2/2018 11:58 PM 639488 Newtonsoft.Json.dll
-a---- 10/2/2018 11:58 PM 118272 Serilog.dll
-a---- 10/2/2018 11:58 PM 8704 Serilog.Sinks.Async.dll
-a---- 10/2/2018 11:58 PM 31744 Serilog.Sinks.Console.dll
-a---- 10/2/2018 11:58 PM 26624 Serilog.Sinks.File.dll
-a---- 10/2/2018 11:58 PM 4096 UnixConsoleEcho.dll
Directory: C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin\6.0
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/2/2018 11:58 PM 29840 System.IO.Pipes.AccessControl.dll
-a---- 10/2/2018 11:58 PM 104584 System.Security.AccessControl.dll
-a---- 10/2/2018 11:58 PM 82576 System.Security.Principal.Windows.dll
Directory: C:\Users\XXXXX\.vscode-insiders\extensions\ms-vscode.powershell-2.0.0\modules\PowerShellEditorServices\bin\Desktop
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 10/2/2018 11:58 PM 25744 System.IO.Pipes.AccessControl.dll
-a---- 10/2/2018 11:58 PM 39048 System.Security.AccessControl.dll
-a---- 10/2/2018 11:58 PM 23688 System.Security.Principal.Windows.dll
VSCode Info
Version: 1.28.0-insider (system setup)
Commit: 85d970acdee48f6dcecf909a0faeb3c6882217a9
Date: 2018-10-02T22:27:52.997Z
Electron: 2.0.9
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64
I have been trying it out all morning at work and it is FANTASTIC. Thanks to all who put their hard work into this. I must admit that the missing ability to paste multi-line code into VSCode's terminal had really been keeping me unhappy and wandering back to ISE, so this really makes my day.
A few minor and not really critical (to me) questions about a few of the KeyHandler functions.
Should CopyOrCancelLine, AddLine, BackwardDeleteLine, ForwardDeleteLine, ScrollDisplayUpLine, and ScrollDisplayDownLine be working?
CopyOrCancelLine - I get ^C
AddLine - Just acts like AcceptLine aka Enter
BackwardDeleteLine - Takes me to the top of the terminal history (hijacked somewhere by another shortcut?)
ForwardDeleteLine - Does nothing
ScrollDisplayUpLine - scrolls up a screen instead of a line
ScrollDisplayDownLine - scrolls down a screen instead of a line
Oh and note that oddly ScrollDisplayDown will let you keep going page after page beyond your actual terminal text and then you have to page up just as many to get back!
Again, many thanks to everyone! I have been telling all my coworkers it is time to finally ditch ISE forever now.
If you want Back/ForwardDeleteLine to work, add this to your keybindings.json file:
{
"key": "ctrl+home",
"command": "-workbench.action.terminal.scrollToTop",
"when": "terminalFocus"
},
{
"key": "ctrl+end",
"command": "-workbench.action.terminal.scrollToBottom",
"when": "terminalFocus"
}
For ScrollDisplayUp/DownLine, I just the built-in kbd shortcuts ctrl+alt+PageUp/Down. In theory, you could use these keybindings to make ctrl+PageUp/Down work but the ctrl is not getting through, so PSRL sees just PageUp/Down.
{
"key": "ctrl+pageup",
"command": "-workbench.action.previousEditor"
},
{
"key": "ctrl+pageup",
"command": "workbench.action.previousEditor",
"when": "!terminalFocus"
},
{
"key": "ctrl+pageup",
"command": "-workbench.action.previousEditor"
},
{
"key": "ctrl+pagedown",
"command": "workbench.action.nextEditor",
"when": "!terminalFocus"
}
The same happens with AddLine - only the Enter is getting to PSRL. You can see this by pressing Alt+Shift+/ and then pressing any keyboard chord. PSRL will tell you what it sees.
BTW this all happens in the regular PowerShell integrated terminal w/PSRL so it's not specific to PSIC.
Working fairly well for me, FYI here are the settings to get the PSReadline terminal to match the default Dark+ theme, and match the default powershell console colors otherwise (I commented out background to match most themes more easily)
Should I submit this to be default as a separate PR (for Dark+ at least)? Would make it look a lot cleaner and better for new users for a seamless experience.
"workbench.colorCustomizations": {
"[Default Dark+]": {
//Dark+ Console Theme
//"terminal.background": "#0c0c0c",
"terminal.ansiBlack": "#000000",
"terminal.ansiBlue": "#569cd6",
"terminal.ansiGreen": "#608b4e",
"terminal.ansiCyan": "#ce9178",
"terminal.ansiRed": "#f44747",
"terminal.ansiMagenta": "#646695",
"terminal.ansiYellow": "#d7ba7d",
"terminal.ansiWhite": "#d4d4d4",
"terminal.ansiBrightBlack": "#808080",
"terminal.ansiBrightBlue": "#9cdcfe",
"terminal.ansiBrightGreen": "#b5cea8",
"terminal.ansiBrightCyan": "#4EC9B0",
"terminal.ansiBrightRed": "#d16969",
"terminal.ansiBrightMagenta": "#c586c0",
"terminal.ansiBrightYellow": "#dcdcaa",
"terminal.ansiBrightWhite": "#d4d4d4",
},
//"terminal.background": "#012456",
"terminal.foreground": "#cccccc",
"terminal.ansiBlack": "#0c0c0c",
"terminal.ansiBlue": "#0037da",
"terminal.ansiGreen": "#13a10e",
"terminal.ansiCyan": "#3a96dd",
"terminal.ansiRed": "#c50f1f",
"terminal.ansiMagenta": "#881798",
"terminal.ansiYellow": "#c19c00",
"terminal.ansiWhite": "#cccccc",
"terminal.ansiBrightBlack": "#767676",
"terminal.ansiBrightBlue": "#3b78ff",
"terminal.ansiBrightGreen": "#16c60c",
"terminal.ansiBrightCyan": "#61d6d6",
"terminal.ansiBrightRed": "#e74856",
"terminal.ansiBrightMagenta": "#b4009e",
"terminal.ansiBrightYellow": "#f9f1a5",
"terminal.ansiBrightWhite": "#f2f2f2",
},
"editor.tokenColorCustomizations": {
"[Default Dark+]": {
"comments": "#608b4e"
}
},
Hi everyone, we now have an AppVeyor artefact that you can download directly here.
To get the most up-to-date build of the 2.0.0 extension, go to the branches page, and next to the 2.0.0 branch there should be a green ✔️. Click on that and on the right of the AppVeyor build there should be a Details link. Click on that and on the new screen above the console there should be an Artifacts tab. That will have the latest VSIX in it. I can't give a generic link to that, since it's build-specific, but hopefully you'll be able to find it.
We're still exploring the best way to have a "release" of the v2 extension while still (1) honouring our commitment to have a support window for the 1.x extension and (2) continuing to do work that we could only do with a major version increment before stabilising it.
I hate to say, but the "endless Enter loop" issue is still there with that 2.0.0 candidate...
Yes, it's the same build. But now builds will be available in a consistent place as soon as they are committed rather than requiring a manual build.
@sba923 To solve the endless loop, we'll need more information to reproduce it. I hit it once, but it resolved. Can you please open a new issue for the looping problem and provide the system information described in the troubleshooting doc.
thanks, @rjmholt!!
That package seems to contain errors?
From the log file...
2018-10-09 10:05:59 - Microsoft.VisualStudio.ExtensionManager.InvalidExtensionManifestException: Element 'Identity' has invalid value for attribute 'Version' ---> System.FormatException: Input string was not in a correct format.
at System.Version.VersionResult.SetFailure(ParseFailureKind failure, String argument)
@pezmannen To install it in VSCode press F1 and start typing Install from VSIX.
@pezmannen seems like Version contains a semver which isn't a valid System.Version
@pezmannen VSCode shares its file extension (.vsix) with Visual Studio. On Windows, running it from the browser or executing it directly will attempt to load it into Visual Studio, which will fail since the actual format is different.
To install the VSIX in VSCode, you need to either
code --install-extension ./path/to/PowerShell-insiders.vsix from PowerShell... context menu under VSCode's Extensions view and select Install from VSIX...The link in this comment has further instructions.
I've opened #1570 about the endless prompt loop.
Hi everyone, we now have an AppVeyor artefact that you can download directly here.
To get the most up-to-date build of the 2.0.0 extension, go to the branches page, and next to the
2.0.0branch there should be a green ✔️. Click on that and on the right of the AppVeyor build there should be aDetailslink. Click on that and on the new screen above the console there should be anArtifactstab. That will have the latest VSIX in it. I can't give a generic link to that, since it's build-specific, but hopefully you'll be able to find it.We're still exploring the best way to have a "release" of the v2 extension while still (1) honouring our commitment to have a support window for the 1.x extension and (2) continuing to do work that we could only do with a major version increment before stabilising it.
@rjmholt Do both the 1.9.x and 2.x insider releases support PSReadLine? I see there are frequent releases of the 1.9.x branch but the 2.x hasn't seen an updated build since some time in October. I guess my question should be, "Which branch should be be testing if we want to work with PSReadLine support?"
TL;DR:
Which branch should be be testing if we want to work with PSReadLine support?
2.0.0
Only 2.0.0 supports PSReadLine, because supporting PSReadLine involves breaking changes. It is the reason there is a 2.0.0 branch.
The 2.0.0 branch is downstream of the 1.x/master branch -- the changes in master will come into 2.0.0, but that work needs to be done manually and I'm currently juggling a few other things. I'm hoping to work on that in the next couple of weeks.
I've tested the build from https://ci.appveyor.com/api/buildjobs/ma1a8og5h1d0g5cu/artifacts/PowerShell-insiders.vsix and I still get the "endless loop on prompt" behavior...
TL;DR:
Which branch should be be testing if we want to work with PSReadLine support?
2.0.0
Only 2.0.0 supports PSReadLine, because supporting PSReadLine involves breaking changes. It is the reason there is a 2.0.0 branch.
@rjmholt Awesome! I've installed the latest v.2.0 build and it looks like it's fixed a couple of issues I was having with Vi mode. 😄
Is there any chance we'll get support for chords like Ctrl+Shift+Esc?
@gwojan, ah I’m also a Vi mode user but because it’s less popular and quite different, it’s got a few more kinks in it.
PSReadLine itself lives here. Fixes and features in the actual PSReadLine experience come from there.
@gwojan, ah I’m also a Vi mode user but because it’s less popular and quite different, it’s got a few more kinks in it.
PSReadLine itself lives here. Fixes and features in the actual PSReadLine experience come from there.
@rjmholt Thanks. I keep mine updated with the latest and greatest. 😉
BTW, I opened a new issue after installing the v2.0 extension this morning Node module infected with trojan.
Just FYI everyone, we've checked and respun the builds to make sure no event-stream stuff is in them now. I would recommend changing over to the new builds.
We're working on sorting out a couple of issues in the latest 1.x release before investing the time in rebasing 2.0.0, but it will happen soon.
There is one last major issue we're working through to make PSReadLine support viable, involving prompt cancellation -- so we want to fix that before we create a proper release channel. We're working on it, but @TylerLeonhardt and I are currently juggling some other stuff at the minute (I am porting Windows PowerShell modules to work with PowerShell Core, for example). Anyway, we're very conscious of all of it, we just want to make sure that when we release it's something that will be reliable and useful.
When can we hope to get the "endless loop" problem fixed? This is a showstopper for moving from ISE to VScode…
Btw, this also blocks the fix for this issue that is fixed in PSReadLine but still appears in the integrated console: https://github.com/PowerShell/PowerShell/issues/5983
Any status update on this?
You can try this feature via the preview version of the extension. See https://blogs.msdn.microsoft.com/powershell/2019/01/23/announcing-the-powershell-preview-extension-in-vscode/
Tried it, it's still unusable due to the "endless prompting loop" issue (which you said you encountered too at https://github.com/PowerShell/vscode-powershell/issues/1570#issuecomment-457621468)!
What could I do to help fix that?
@sba923 You're the only one complaining about an "endless loop" issue for which you've been prompted for further diagnostic information. I suggest opening an issue if you actually have a problem instead of detracting from this 2.0 discussion.
I'm not the only one, see @rkeithhill's comment on the _existing_ issue for that exact "endless loop" problem.
This is related to non-US keyboard layouts, and just makes version 2.0 of the PowerShell extension for VScode plainly unusable if you happen to have such a keyboard.
Why does the Integrated Console even have to be visible? Why not start a PowerShell instance in the background for error-checking, etc.?
@doxxx - It doesn't. You can uncheck PowerShell > Integrated Console: Show On Startup in your Code settings to not show it if you prefer it not to show. This should still allow the language server to start so you get the rest of the features that come with that (i.e. error checking).
@scrthq I do have that disabled. The problem, however, is that when I press the Terminal: Focus Terminal shortcut, it shows me the PowerShell Integrated Console. IMO, it shouldn't even appear in the list of terminals if that option is disabled.
The problem with that is that the PowerShell Integrated Console holds the PowerShell session that is used to give all the editor features - intellisense, codelens, etc.
This was done to give an experience similar to that of the ISE (editor up top, console on the bottom) - something that a lot of users had to have to adopt the PowerShell extension.
Short of major architectural change, what you're asking for is not going to be possible, I'm afraid.
_Maybe_ someone could take PowerShell Editor Services which is the backend to the PowerShell extension and leverage the -Stdio flag to create a "PowerShell lite" extension that does more what you're looking for... but it's probably not something we can address in the short term at least.
I hadn't realized that replicating the experience of the PowerShell ISE was the goal of the extension. That explains a lot. :)
I just tried the PowerShell Preview extension with the PSReadLine support enabled. Everything appears to be working correctly! Thanks so much for this!
Is Ctrl+Backspace supposed to be working with PSReadLine support in the latest preview build?
Try putting this in your VSCode specific profile - (Microsoft.VSCode_profile.ps1):
Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardKillWord
Set-PSReadLineKeyHandler -Chord 'Alt+D' -Function KillWord
Set-PSReadLineKeyHandler -Chord 'Ctrl+@' -Function MenuComplete
Try putting this in your VSCode specific profile - (Microsoft.VSCode_profile.ps1):
Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardKillWord Set-PSReadLineKeyHandler -Chord 'Alt+D' -Function KillWord Set-PSReadLineKeyHandler -Chord 'Ctrl+@' -Function MenuComplete
Thanks - I had to put this in Microsoft.PowerShell_profile.ps1, but it worked!
$profile is set to that file according to VSCode's terminal.
Sorry, I thought you were trying out the PSRL support in the PowerShell Integrated Console which does load the VSCode profile. The profile you put this in will load in both the PSIC and the regular integrated terminal. But it will also load this into any PowerShell console. You might want to fire up a PowerShell console and make sure backspace still works as you expect.
I have ConPTY set up with the VSCode extension, if that makes any difference. I changed that after seeing somewhere (github issue, probably) that I should use ConPTY to have keyboard shortcuts like this.
Cool. Well if you wind up with issues in the external PowerShell console, you could conditionally invoke the above script like so:
if ($env:TERM_PROGRAM -eq "vscode") {
Set-PSReadLineKeyHandler -Chord 'Ctrl+w' -Function BackwardKillWord
Set-PSReadLineKeyHandler -Chord 'Alt+D' -Function KillWord
Set-PSReadLineKeyHandler -Chord 'Ctrl+@' -Function MenuComplete
}
There is also a $env:TERM_PROGRAM_VERSION that might come in handy.
Still. Waiting.
@Jaykul you can use it in the powershell preview module that was published, unless you're waiting on something else?
@JustinGrote The preview module doesn't show up as an available module on code-insiders, fwiw.
@rfoust it should. They both pull from the same marketplace.
Search for "PowerShell" and look down the list. I remember seeing it about half way down the page.
Oh you're right, there it is. Not sure why I didn't see it last night. :)
Closing as PSReadLine is now available in the PowerShell Preview extension, tracking that PSReadLine is not available in the main PowerShell Extension here #1793
After updating to the non-preview powershell extension v 2020.1.0 and vscode 1.42.1, I have lost syntax highlighting in the integrated console. The actual code editor is working fine. Any ideas?
@iampeterdaniels non-preview extension doesn't have PSReadline, you have to use the preview extension for psreadline functionality (which includes syntax highlighting, special characters, etc.)
Thank you, Justin. Not sure why I thought the PSReadline 2.0 release somehow translated into it being in the non-preview extension.
@iampeterdaniels the current preview extension should roll into stable very soon, they're trying to target it for the PS7 release which will probably drop sometime this week or next.
Most helpful comment
Ok I've uploaded a new VSIX in the comment above (psvsix.zip).
I've made sure that this one works with Windows PowerShell, PowerShell Core 6.0 and PowerShell Core 6.1.
Give that a try 😄