Repository navigation
Stop terminal color codes from crashing boards without a suitable palette - #11705
Merged
Merged
Conversation
The m handler treated any pixel shader as a Palette, so a color escape on a ColorConverter, TilePaletteMapper or one-entry Palette could hard fault or corrupt memory. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Stop a terminal color code from crashing the board when the terminal has no suitable palette.
Why
The terminal treats any color source as a palette, so a color code can corrupt memory or hard fault.
Found while testing #10478 and #11704.
ColorConverter,TilePaletteMapper, including a shader swapped in laterPalette(1)next to another objectPalette(2),Palette(8), REPLBehavior change:
ESC[4xmon aPalette(1)used to set entry 0 and is now ignored.Flash cost: 64 to 92 bytes on CLUE, Feather nRF52840, M4, RP2350, STM32F405 and ESP32-S2.
@lynt-smitka your cp-desktop-lab found this crash before any hardware run.
AI assistance
Claude Code wrote the fix and ran the tests above on boards and the lab. Before and after share a commit on every board.
🤖 Generated with Claude Code