Skip to content

Clear the terminal via the LSP - #1108

Merged
TylerLeonhardt merged 3 commits into
PowerShell:masterfrom
TylerLeonhardt:clear-terminal-via-lsp
Nov 27, 2019
Merged

Clear the terminal via the LSP#1108
TylerLeonhardt merged 3 commits into
PowerShell:masterfrom
TylerLeonhardt:clear-terminal-via-lsp

Conversation

@TylerLeonhardt

@TylerLeonhardt TylerLeonhardt commented Nov 19, 2019

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

2 participants