Skip to content

Cannot mix RGB colors with other attributes in single sequence #4

@djnalluri

Description

@djnalluri

When using an RGB foreground and background attribute, I noticed that using both in a single sequence results in the second color being applied to whichever prefix comes first. For example, CSI 38 ; 2 ; 0 ; 0 ; 0 ; 48 ; 2 ; 255 ; 255 ; 255 m results in the foreground being set to white even though foreground has been successfully set to black and followed up with a white background attribute.

Looking at the code, it seems once an RGB attribute is started, it will not stop consuming parameters until they are exhausted.
https://github.com/danielgatis/go-ansicode/blob/main/performer_csi.go#L434

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions