-
Couldn't load subscription status.
- Fork 240
Use a provided shell integration script directly #2156
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
Conversation
This was prompted by a) being annoyed at having to keep doing this and b) the changes in microsoft/vscode@d60e424 being much more difficult to incorporate except by doing it this way! /cc @Tyriar
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
f85e2f8 to
6342ce8
Compare
22b95ae to
fd1bb23
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like C# 11's triple-quote double-dollar thing. Very useful.
da3894a to
400dce5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tyriar just a heads-up here that your PSConsoleHostReadLine wrapper must continue to write those escape sequences directly, as we're intentionally not emitting the output (like the returned value) to the host. Write-Host might work (though you don't use it), but we'd need to test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No real change, it's the default.
400dce5 to
6d6bc34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookin' good, just two fixes real quick
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
src/PowerShellEditorServices/Services/PowerShell/Host/PsesInternalHost.cs
Outdated
Show resolved
Hide resolved
Instead of having to maintain an edited copy (which was really annoying) I stubbed out `PSConsoleHostReadLine` to do what's expected. So now we can just use the existing shell integration script directly! Since we can't reliably find the script using `code --locate-shell-integration-path pwsh` we now rely on it being sent by the client on initialization. Its presence implies the feature is on. This is pretty VS Code specific, but not necessarily so. Apply suggestions from code review Thanks Patrick! Co-authored-by: Patrick Meinecke <SeeminglyScience@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
9a9f893 to
f5bc51d
Compare
Uh oh!
There was an error while loading. Please reload this page.
Instead of having to maintain an edited copy (which was really annoying) I stubbed out
PSConsoleHostReadLineto do what's expected. So now we can just use the existing shell integration script directly!Since we can't reliably find the script using
code --locate-shell-integration-path pwshwe now rely on it being sent by the client on initialization. Its presence implies the feature is on.This is pretty VS Code specific, but not necessarily so.