-
Notifications
You must be signed in to change notification settings - Fork 237
Graduate PSReadLine feature and add UseLegacyReadLine #1076
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -171,19 +171,26 @@ public static PowerShellContextService Create( | |||||
ProfilePaths profilePaths, | ||||||
HashSet<string> featureFlags, | ||||||
bool enableConsoleRepl, | ||||||
bool useLegacyReadLine, | ||||||
PSHost internalHost, | ||||||
HostDetails hostDetails, | ||||||
string[] additionalModules | ||||||
) | ||||||
{ | ||||||
var logger = factory.CreateLogger<PowerShellContextService>(); | ||||||
|
||||||
// PSReadLine can only be used when -EnableConsoleRepl is specified otherwise | ||||||
// issues arise when redirecting stdio. | ||||||
// We should only use PSReadLine if we specificied that we want a console repl | ||||||
// and we have not explicitly said to use the legacy ReadLine. | ||||||
// We also want it if we are either: | ||||||
// * On Windows on any version OR | ||||||
// * On Linux or macOS on any version greater than or equal to 7 | ||||||
var shouldUsePSReadLine = enableConsoleRepl && !useLegacyReadLine | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixed! |
||||||
&& (VersionUtils.IsWindows || (!VersionUtils.IsWindows && !VersionUtils.IsPS6)); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call - fixed! |
||||||
|
||||||
var powerShellContext = new PowerShellContextService( | ||||||
logger, | ||||||
languageServer, | ||||||
featureFlags.Contains("PSReadLine") && enableConsoleRepl); | ||||||
shouldUsePSReadLine); | ||||||
|
||||||
EditorServicesPSHostUserInterface hostUserInterface = | ||||||
enableConsoleRepl | ||||||
|
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.
Possible to use named args here?
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.
Fixed!