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

Fixes #131 - Out-ConsoleGridView doesn't handle ANSI escape sequences correctly #154

Closed
wants to merge 33 commits into from

Conversation

tig
Copy link
Collaborator

@tig tig commented Jun 3, 2022

This PR Fixes #131

Previous to PowerShell 7.1, it would have been uncommon for a cmdlet to receive input decorated with ANSI escape sequences. But support for ANSI was added in 7.1 (see PowerShell/PowerShell#13071).

This PR adds a single line of code, a RegEx, to strip ANSI escape sequences from the input text.

This PR is a draft because

a) A regex is probably not the most robust way to strip ANSI. Apparently PS has a built-in capability (StringDecorated) but that is internal.
b) Pulling in all of Regex is overkill probably
c) I'm not 100% certain that TypeGetter.cs is the right place to do the stripping.

Comments appreciated.

tig and others added 30 commits March 11, 2020 15:55
Co-Authored-By: Tyler James Leonhardt <tylerl0706@gmail.com>
@tig tig closed this Jul 30, 2022
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.

Out-ConsoleGridView doesn't handle ANSI escape sequences correctly
1 participant