Sync from development - prepare for v0.1.7

This commit is contained in:
Omni
2025-11-04 12:54:15 +00:00
parent 91ac08afb2
commit 9680814bbb
25 changed files with 4560 additions and 259 deletions

View File

@@ -9,6 +9,21 @@ ANSI_COLOR_MAP = {
}
ANSI_RE = re.compile(r'\x1b\[(\d+)(;\d+)?m')
# Pattern to match terminal control codes (cursor movement, line clearing, etc.)
ANSI_CONTROL_RE = re.compile(
r'\x1b\[' # CSI sequence start
r'[0-9;]*' # Parameters
r'[A-Za-z]' # Command letter
)
def strip_ansi_control_codes(text):
"""Remove ALL ANSI escape sequences including control codes.
This is useful for Hoolamike output which uses terminal control codes
for progress bars that don't render well in QTextEdit.
"""
return ANSI_CONTROL_RE.sub('', text)
def ansi_to_html(text):
"""Convert ANSI color codes to HTML"""
result = ''