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

Open
opened 2026-01-31 01:10:26 +00:00 by claunia · 0 comments
Owner

Originally created by @ahuggel on GitHub (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

Originally created by @ahuggel on GitHub (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](https://github.com/microsoft/terminal/files/4533212/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](https://user-images.githubusercontent.com/972802/80283023-57948380-8747-11ea-9afd-77713164118f.png) # 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](https://user-images.githubusercontent.com/972802/80283025-595e4700-8747-11ea-8822-725ccab78f26.png)
claunia added the Resolution-Duplicate label 2026-01-31 01:10:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7687