-
Notifications
You must be signed in to change notification settings - Fork 499
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 char @ is added in the output of all scripts #2274
PSReadline char @ is added in the output of all scripts #2274
Comments
I have a similar thing. F8 for run selection will insert
|
Yes this seems to be an issue in PSReadLine. I'm investigating it and can repro |
Thankfully, the |
This was introduced in PowerShell/PowerShellEditorServices#1072 What's the saying? "1 bug fixed, 2 more appear"? 😅 |
/cc @daxian-dbw |
So I've done some debugging here and it looks like our API with PSReadLine isn't quite right. Here is where we implement our own version of Currently, when it cancels, it sends back I played with turning it into a space, returning Short term, we should find a character that is as helpful as possible that we can return here. Medium term, we should work with @daxian-dbw to change the way we interact with PSReadLine either to make this |
Give this VSIX a try and let me know if it solves things. @PrzemyslawKlys I'm particularly interested in whether it solves any of your other bugs. |
@rjmholt That fixes it for me! |
That's what I get after installing and running this extension. So I guess PSReadLine is not working :-) |
@rjmholt the VSIX solve the problem for me but as @PrzemyslawKlys mentioned with the VSIX version when using PowerShell 5.1 (7.0 works fine) when you "F5" you get the error @PrzemyslawKlys posted. Is this a new bug in your fix? or did you just forgot to pack something in the VSIX? |
@ili101 @PrzemyslawKlys can you tell me if PSReadLine is available in your Integrated Console? ( |
Sorry I need the prerelease version.
Should be in there. |
|
One last thing:
Or if you use vscode insiders:
|
|
Ok the problem here is that we're not loading the correct PSReadLine. |
Try |
I suspect we need to update our PSRL load logic -- the issue is that we need something in a particular beta version (and PSRL's version scheme combined with the module system's support for prerelease versions makes life hard) |
It seems to be related to how you handle prompt. It seems you "add" your own prompt with PSReadLine, when it's already added. if I use something like this: $DirectoryPath = "$Env:USERPROFILE\Desktop"
"$DirectoryPath\ExportDCInventory-$($DC.HostName).xml" The output will be: But then if you press Enter it will bring proper prompt back. So either you have to skip adding your own prompt or overwrite the original one. |
Here is the script we use to find PSReadLine, which specifically drops It may be that the |
Yes that's probably us renewing the prompt improperly. We already fudge the prompt correctly in a number of cases, it just doesn't look like it. We can continue that discussion in #2276 if that's alright. Just want to keep the discussions separate (primarily so I don't get confused). |
Just to add, installing the new .vsix on another machine:
It seems like the VSIX (the one .zipped) is missing some paths.
Not sure what is missing on my home machine. |
Issue Description
I am experiencing a problem with PSReadline random chars being added to the output of all scripts.
After the script is done, press ENTER and it shows the error as above.
Attached Logs
Follow the instructions in the README about
capturing and sending logs.
Environment Information
Visual Studio Code
PowerShell Information
Visual Studio Code Extensions
Visual Studio Code Extensions(Click to Expand)
The text was updated successfully, but these errors were encountered: