Skip to content

Commit

Permalink
Strip more color sequences from qubes-dom0-update output
Browse files Browse the repository at this point in the history
DNF5 likes to add more colors...

QubesOS/qubes-issues#9244
  • Loading branch information
marmarek committed Dec 13, 2024
1 parent 17de6bd commit 9ce126b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions _modules/qubes_dom0_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def _sanitize_output(output):
# drop coloring sequences added by qubes-dom0-update (if any)
if output.startswith("\033[0;"):
output = output[7:]
if output.startswith("\033[1m"):
output = output[4:]
if output.startswith("\033[34m"):
output = output[5:]
if output.endswith("\033[0m"):
output = output[:-4]
output = output[:3000] # arbitrary limit
Expand Down

0 comments on commit 9ce126b

Please sign in to comment.