Skip to content
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

Clear the terminal via the LSP #1108

Merged

Conversation

TylerLeonhardt
Copy link
Member

@TylerLeonhardt TylerLeonhardt commented Nov 19, 2019

This fixes an "issue" that comes up a lot that when you Clear-Host and are still able to scroll up.

On non-Windows this is the typical behavior of Clear-Host but on Windows the expectation is that the console is truly cleared out. This sends a message to the client to say "hey clear the terminal" and if the terminal properly supports a "true clear" in can register a handler for this notification.

Pairs with: PowerShell/vscode-powershell#2316

Microsoft.PowerShell.Management\Get-Item function:Clear-Host | Microsoft.PowerShell.Management\Set-Item function:__clearhost

function Clear-Host {
[Alias('cls')]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also clear?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clear is not an alias it's an application on non-Windows. Is it an alias on Windows?

@TylerLeonhardt
Copy link
Member Author

Codacy Here is an overview of what got changed by this pull request:

Issues
======
+ Solved 1
           

Complexity increasing per file
==============================
- src/PowerShellEditorServices/Services/PowerShellContext/Extensions/EditorTerminal.cs  1
         

See the complete overview on Codacy

@TylerLeonhardt TylerLeonhardt merged commit e813fbd into PowerShell:master Nov 27, 2019
@TylerLeonhardt TylerLeonhardt deleted the clear-terminal-via-lsp branch April 11, 2020 19:39
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.

2 participants