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

Background color not set when paging through a document with ANSI escape sequences #5565

Closed
ahuggel opened this issue Apr 25, 2020 · 4 comments
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.

Comments

@ahuggel
Copy link

ahuggel commented Apr 25, 2020

Environment

Windows build number: Microsoft Windows [Version 10.0.18363.778]
Windows Terminal version (if applicable): 0.11.1121.0

Steps to reproduce

Page through the attached pentomino.txt file, e.g., less -R pentomino.txt in WSL Debian or more pentomino.txt in cmd.

The file contains simple graphical representations of the solutions of a puzzle, drawn with spaces and ANSI escape sequences to vary the background color, like this:

ESC[105m        ESC[100m  ESC[101m        ESC[106m  ESC[49m
ESC[105m  ESC[41m  ESC[43m    ESC[100m    ESC[101m  ESC[103m  ESC[106m    ESC[49m
ESC[41m      ESC[43m    ESC[100m  ESC[103m    ESC[106m    ESC[49m
ESC[47m  ESC[41m  ESC[47m  ESC[44m  ESC[43m  ESC[100m  ESC[45m  ESC[103m    ESC[46m  ESC[49m
ESC[47m      ESC[44m      ESC[45m      ESC[46m  ESC[49m
ESC[102m          ESC[44m  ESC[45m  ESC[46m      ESC[49m

Expected behavior

The horizontal bar at the beginning of the last line of the field (ESC[102m ) should be green.

correct-color

Actual behavior

When paging through the file, the bar is most of the time drawn in the background color instead of green. When scrolling through the file slowly with the arrow down key, the issue does not show. It only seems to happen for the green bar piece, when it is horizontal and starts in the first column.

wrong-color

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 25, 2020
@Sandra2001
Copy link

Sandra2001 commented Apr 25, 2020

@ahuggel Good error found! 😁

(●'◡'●) Your @Sandra2001

@DHowett-MSFT
Copy link
Contributor

So, I got to see this with 40. Solution; based on the debugging tap output:

40.␣Solution:␍␊Sat␣Apr␣25␣15:31:02␣2020␍␊␊␛[47m␣␣␣␣␣␣␛[101m␣␣␣␣␣␣␣␣␛[106m␣␣␣␣␣␣␛[m␛[K␍␊␛[47m␣␣␛[41m␣␣␛[47m␣␣␛[44m␣␣␣␣␛[101m␣␣␛[103m␣␣␛[106m␣␣␣␣␛[43m␣␣␛[m␛[K␍␊␛[41m␣␣␣␣␣␣␛[44m␣␣␛[100m␣␣␛[103m␣␣␣␣␣␣␛[43m␣␣␣␣␛[m␛[K␍␊␛[105m␣␣␛[41m␣␣␛[44m␣␣␣␣␛[100m␣␣␛[103m␣␣␛[46m␣␣␛[43m␣␣␣␣␛[45m␣␣␛[m␛[K␍␊␛[105m␣␣␣␣␣␣␣␣␛[100m␣␣␣␣␛[46m␣␣␛[45m␣␣␣␣␣␣␛[m␛[K␍␊␛[102m␛[100m␛[10C␣␣␛[46m␣␣␣␣␣␣␛[45m␣␣␛[m␛[K␍␊␊␊

this is a /dupe of #5502.

We're incorrectly optimizing runs of spaces that differ only in background color; evidenced by the "␛[102m␛[100m␛[10C" ("set background color to 2, 0, move 10 cells right").

@ghost
Copy link

ghost commented Apr 25, 2020

Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report!

@ghost ghost closed this as completed Apr 25, 2020
@ghost ghost added Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing. and removed Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 25, 2020
@DHowett-MSFT
Copy link
Contributor

Thanks for the report!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate There's another issue on the tracker that's pretty much the same thing.
Projects
None yet
Development

No branches or pull requests

3 participants