Skip to content

Commit

Permalink
Red text (errors) nearly impossible to read when running in powershel…
Browse files Browse the repository at this point in the history
…l with blue background. Adjust to make all red text bright when powershell is detected.
  • Loading branch information
frankyrumple committed Jul 10, 2024
1 parent fa15fed commit b7fd034
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client_tools/svc/color.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import util
import psutil
#import logging
from mgmt_EventLog import EventLog

Expand Down Expand Up @@ -139,6 +140,13 @@ def init_logger():

}

# POWERSHELL FIXES - Adjust colors when running in powershell to make them more readable
# Get parent process name
parent_proc_name = psutil.Process(os.getppid()).name()
if 'pwsh' in parent_proc_name or 'powershell' in parent_proc_name:
# Make red only use bold so it is readable
color_codes["}}rn"] = color_codes["}}rb"]

markup_color_codes = {

"}}xx": "[/color]",
Expand Down

0 comments on commit b7fd034

Please sign in to comment.