MCPcopy Create free account
hub / github.com/Keeper-Security/Commander / strip_ansi_codes

Function strip_ansi_codes

keepercommander/commands/supershell/utils.py:40–43  ·  view source on GitHub ↗

Remove ANSI color codes from text

(text: str)

Source from the content-addressed store, hash-verified

38
39
40def strip_ansi_codes(text: str) -> str:
41 """Remove ANSI color codes from text"""
42 ansi_escape = re.compile(r'\x1b\[[0-9;]*m')
43 return ansi_escape.sub('', text)
44
45
46def escape_rich_markup(text: str) -> str:

Calls

no outgoing calls

Tested by

no test coverage detected