Skip to content

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

Merged
merged 20 commits into from
Mar 14, 2017

Conversation

daviwil
Copy link
Contributor

@daviwil daviwil commented Feb 8, 2017

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.

@daviwil daviwil added this to the 0.10.0 milestone Feb 8, 2017
@daviwil
Copy link
Contributor Author

daviwil commented Feb 8, 2017

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.

@daviwil daviwil force-pushed the daviwil/console-redux branch from 6fce117 to bb504d5 Compare February 8, 2017 23:50
@daviwil daviwil force-pushed the daviwil/console-redux branch from 897a966 to 241ef16 Compare February 17, 2017 23:44
@daviwil daviwil force-pushed the daviwil/console-redux branch from ee53058 to a080b5b Compare March 6, 2017 01:51
daviwil added 12 commits March 5, 2017 18:02
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.
@rkeithhill
Copy link
Contributor

+4,659 −2,686 Now that is one heck of a PR!

@daviwil
Copy link
Contributor Author

daviwil commented Mar 6, 2017

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...

daviwil added 5 commits March 6, 2017 07:13
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.
@daviwil daviwil force-pushed the daviwil/console-redux branch from a080b5b to 930e0a5 Compare March 6, 2017 22:21

private bool isUnix = false;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@Julianzs
Copy link

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!

daviwil added 2 commits March 13, 2017 16:29
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.
@daviwil daviwil force-pushed the daviwil/console-redux branch from 4496956 to ef35db7 Compare March 13, 2017 23:30
@daviwil daviwil merged commit aaad6f3 into develop Mar 14, 2017
@daviwil daviwil deleted the daviwil/console-redux branch April 26, 2017 20:04
TylerLeonhardt pushed a commit to TylerLeonhardt/PowerShellEditorServices that referenced this pull request Feb 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants