-
Notifications
You must be signed in to change notification settings - Fork 238
Add integrated console support via custom host implementation #368
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 change is pretty massive so don't be in a hurry to review it. I've got a pretty good feeling that many tests will fail, I'll look into those later today. I might have to disable some tests temporarily until I can come up with a new testing strategy that leverages the new console experience. My goal is to get this merged today so that people can try out a preview build. I'll be sending a corresponding PR to the vscode-powershell repo after this gets merged. |
6fce117
to
bb504d5
Compare
897a966
to
241ef16
Compare
ee53058
to
a080b5b
Compare
This change enables a true integrated terminal experience for editors like VS Code which have an embedded terminal UI. The change centers primarily around the new ConsoleReadLine class which provides a "good enough" terminal editing and tab completion experience until we can find a way to make PSReadLine work inside of our custom host. The debugging experience has also been updated to share the language service's runspace. In a later change an independent debugging mode will be added.
This change adds initial support for Get-Credential, Read-Host -AsSecureString and any input prompt which uses a SecureString or PSCredential parameter.
This change reintroduces the old host interface so that we can maintain our current functional tests until we find a good way to test the new terminal-based UI. This also enables consumers of the old host protocol (like Xamarin Studio) to continue using it.
+4,659 −2,686 Now that is one heck of a PR! |
It's too big... And a couple files got their line endings messed up so it might be reporting incorrectly. Still hacking through some final issues, the rabbit hole goes deeper and deeper... |
This issue is caused when VS Cod sends watch expression evaluation requests after the debugger has been resumed. This issue has been fixed in the most recent builds of VS Code but we must have a guard for this on our side for those who are still using VS Code Stable.
a080b5b
to
930e0a5
Compare
|
||
private bool isUnix = false; |
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.
C# fields are automatically initialized to their default values which is false for a bool.
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.
Yeah, not sure why I initialized it. I was trying to scratch out some code in VS Code on Mac OSX and I think the lack of IntelliSense was screwing up my senses. Something about the net451 TargetFramework was making OmniSharp fail to load the projects correctly.
Very excited about this change, I was told it would meet the exact requirement I was looking for that exists today in the PowerShell ISE: http://stackoverflow.com/questions/42607282/using-visual-studio-code-with-interactive-powershell-window-like-powershell-is/42607437#42607437. Thanks, David! |
This change improves input prompt re-rendering in ConsoleReadLine in a couple of cases: 1. Where the line wraps. The new implementation is simpler and handles terminal resizing correctly. 2. On UNIX-based systems where escape characters are written for certain keypresses like ESC or Backspace. This change overwrites the characters written to the terminal in those cases so that there is no extra noise added to the input line.
This change modifies the build script so that it doesn't build the entire solution file. This is needed because the test projects depend on net452 now due to xUnit requirements; building the solution with both net451 and net452 was causing compilation errors, so it was better to just take that out and let "dotnet test" build the test projects on demand.
4496956
to
ef35db7
Compare
Various fixes for 0.8.0
This change enables a true integrated terminal experience for editors like
VS Code which have an embedded terminal UI. The change centers primarily
around the new ConsoleReadLine class which provides a "good enough"
terminal editing and tab completion experience until we can find a way to
make PSReadLine work inside of our custom host.
The debugging experience has also been updated to share the language
service's runspace. In a later change an independent debugging mode will
be added.