Skip to content

Change Clear-Host back to using $RAWUI and clear to work over remoting - #8609

Merged
Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:clear-host-fix
Jan 10, 2019
Merged

Dongbo Wang (daxian-dbw) merged 1 commit into
PowerShell:masterfrom
SteveL-MSFT:clear-host-fix

Conversation

@SteveL-MSFT

@SteveL-MSFT Steve Lee (SteveL-MSFT) commented Jan 9, 2019 •

Copy link
Copy Markdown
Member

PR Summary

Based on feedback from Bruce Payette (@BrucePay) [Console]::Clear() only works locally and need to revert to using $RAWUI to clear the screen on Windows and clear command to clear on non-Windows so it works over remoting

This reverts part of the change in #8603

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

Maybe simply fallback to RawUI:

try {
    [Console]::Clear
} catch {
    # Use RawUI
}

@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) there's interest to convert this to a C# cmdlet and extend it, so let's defer any enhancements to that effort

@iSazonov

Copy link
Copy Markdown
Collaborator

convert this to a C# cmdlet

Steve Lee (@SteveL-MSFT) Could you please open new Issue for this work? It seems this will be a breaking change and we will need PowerShell Committee approve.

@daxian-dbw Dongbo Wang (daxian-dbw) added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 10, 2019
@SteveL-MSFT

Copy link
Copy Markdown
Member Author

Ilya (@iSazonov) it's implicitly part of #8606 since the way Clear-Host is currently implemented it's impossible to extend

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants