Skip to content

Commit 42ce45d

Browse files
committed
Remove COLOR_CLEAR_BOLD
1 parent 427a19a commit 42ce45d

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

dissect/cstruct/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949

5050
# Reset ANSI codes
5151
COLOR_CLEAR = "\033[0m"
52-
COLOR_CLEAR_BOLD = "\033[1;0m"
5352

5453
PRINTABLE = string.digits + string.ascii_letters + string.punctuation + " "
5554

@@ -155,7 +154,7 @@ def _hexdump(
155154

156155
if active:
157156
values += f"{ord(char):02x}"
158-
chars.append(active + print_char + COLOR_CLEAR_BOLD)
157+
chars.append(active + print_char + COLOR_CLEAR)
159158
else:
160159
if pretty and (color := HUMAN_COLORS.get(char, "")):
161160
values += f"{color}{ord(char):02x}{COLOR_CLEAR}"
@@ -169,10 +168,10 @@ def _hexdump(
169168
active = None
170169

171170
if palette is not None:
172-
values += COLOR_CLEAR_BOLD
171+
values += COLOR_CLEAR
173172

174173
if j == 15 and palette is not None:
175-
values += COLOR_CLEAR_BOLD
174+
values += COLOR_CLEAR
176175

177176
values += " "
178177
if j == 7:

tests/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ def assert_field_color(line: str, ci: int, name: str) -> None:
942942
# Extract background+foreground color regions from the hex portion of the hexdump line.
943943
hexline = lines[1]
944944
bg_pattern = re.compile(
945-
r"(" + "|".join(re.escape(bg) for bg in BG) + r")((?:[0-9a-f]{2}\s*)+)" + re.escape(utils.COLOR_CLEAR_BOLD)
945+
r"(" + "|".join(re.escape(bg) for bg in BG) + r")((?:[0-9a-f]{2}\s*)+)" + re.escape(utils.COLOR_CLEAR)
946946
)
947947
bg_regions = [(bg, hexbytes.split()) for bg, hexbytes in bg_pattern.findall(hexline)]
948948

0 commit comments

Comments
 (0)