Apply newed palette to editor chrome

This commit is contained in:
slhx agent
2026-06-21 21:41:51 +02:00
parent 5652845d2e
commit 3df3b25839
2 changed files with 124 additions and 32 deletions
+12 -12
View File
@@ -87,13 +87,13 @@ def classify_sgr(params: str) -> str:
return ""
parts = [p for p in params.split(";") if p]
joined = ";".join(parts)
if "48;2;245;197;92" in joined:
if "48;2;230;230;230" in joined:
return "cursor"
if "48;2;64;96;140" in joined:
if "48;2;55;65;92" in joined:
return "selection"
if "48;2;26;31;43" in joined:
if "48;2;20;18;26" in joined:
return "current-line"
if "48;2;126;231;135" in joined:
if "48;2;235;119;84" in joined:
return "status"
return ""
@@ -341,10 +341,10 @@ def write_artifacts(out_dir: Path, scenario: Scenario, transcript: bytes, lines:
normalized_visible = normalize_visible_controls(visible)
raw_seen_attrs = set(seen_attrs)
for sgr, attr in (
("48;2;245;197;92", "cursor"),
("48;2;64;96;140", "selection"),
("48;2;26;31;43", "current-line"),
("48;2;126;231;135", "status"),
("48;2;230;230;230", "cursor"),
("48;2;55;65;92", "selection"),
("48;2;20;18;26", "current-line"),
("48;2;235;119;84", "status"),
):
if sgr in normalized_visible:
raw_seen_attrs.add(attr)
@@ -617,10 +617,10 @@ def run_one(mim: Path, root_out: Path, scenario: Scenario) -> tuple[str, Path]:
plain_text = strip_csi(raw_text)
raw_attrs: set[str] = set()
for sgr, attr in (
("48;2;245;197;92", "cursor"),
("48;2;64;96;140", "selection"),
("48;2;26;31;43", "current-line"),
("48;2;126;231;135", "status"),
("48;2;230;230;230", "cursor"),
("48;2;55;65;92", "selection"),
("48;2;20;18;26", "current-line"),
("48;2;235;119;84", "status"),
):
if sgr in raw_text:
raw_attrs.add(attr)