Short answer
Yes, in our test. Colorama 0.4.6 removed all 4 ANSI color codes from a two-line log on Ubuntu 26.04 under WSL2 and left the readable text exactly as it was, character for character.
- Works for: Strip ANSI color codes from a two line log with an explicitly stripping colorama wrapper, checked byte for byte.
- Not covered: anything beyond this one input, version and setup. The project states a limit of its own; see Limits of this test.
- Tested: Colorama 0.4.6 on Ubuntu 26.04 under WSL2, Python 3.14, .
What is Colorama?
Colorama is a small Python library for colored terminal text. Its main job is to make ANSI escape codes, the hidden markers that switch colors on and off, behave on Windows the way they already do on Linux and macOS. It can also take those markers out of text, which is the feature we put to the test here.
Basically the idea is that this makes Windows act like Unix with respect to ANSI escape handling.
Apart from marked quotes, everything on this page comes from our own test run.
How we tested Colorama
We ran Colorama 0.4.6 on (UTC) in an isolated sandbox: Ubuntu 26.04 under WSL2 with Python 3.14. Networking was switched off, so nothing was downloaded or sent during the test. The test ran as an unprivileged user with an empty home directory.
Sandbox checks recorded before the run, all passed: network disabled, home directory blocked, secrets blocked, writes limited to the test workspace.
Setup as recorded: WSL2 Ubuntu 26.04 sandbox: no network, read-only root, nobody user; Python 3.14; local copy of the installed release.
- The input file
logfile(58 bytes) was placed in an empty workspace. - We ran
bin/plain logfile. It exited with code 0. - We kept the exact output (40 bytes) and compared it with the input byte for byte.
- The terminal session was recorded (6.54 seconds).
bin/plain is defined by the test definition in our repository (config/curation/colorama-0.4.6.json), shown below as it stood when this page was built. The script itself is not part of the hashed test record, unlike the input, output and command above.
#!/usr/bin/python3 -I
import sys
sys.path.insert(0, "/tmp/ws")
from colorama import AnsiToWin32
wrapper = AnsiToWin32(sys.stdout, strip=True, convert=False)
wrapper.stream.write(open(sys.argv[1], encoding="ascii").read())
wrapper.stream.flush()
What we saw
What we tried: Strip ANSI color codes from a two line log with an explicitly stripping colorama wrapper.
What went in: 2 lines of text (58 bytes) containing 4 ANSI escape codes: hidden instructions that tell a terminal to change the text color or style.
What came out: 2 lines of text (40 bytes) with no escape codes left. The readable text is exactly the same as in the input.
What this means: The tool removed the color codes and kept every word: the text is the same, character for character. Printed on a terminal, it now shows as plain, uncolored text.
Exact recorded input and output. Invisible characters are written out (for example \x1b is the escape character) so you can see them.
\x1b[92mPASS\x1b[0m build finished
\x1b[93mWARN\x1b[0m cache was cold
PASS build finished
WARN cache was cold
Measured result
- Input size
- 58 bytes
- Output size
- 40 bytes
- Sandbox run time
- 16.17 seconds: the whole isolated sandbox run, including sandbox start-up. This is not the tool's own processing time.
- Demo recording length
- 6.54 seconds
Recorded measurement: 58 input bytes -> 40 output bytes; elapsed 16.17 seconds.
Limits of this test
Any other form of ANSI sequence, such as single-character codes or alternative initial characters, are not recognised or stripped.
This record covers one input, one version (0.4.6) and one platform (Ubuntu 26.04 under WSL2). It is not a speed benchmark: the sandbox time includes start-up. We did not run it on Windows or macOS here, so results there may differ.
Is Colorama a fit for you?
- Likely a fit if you need to strip ANSI color codes from a two line log with an explicitly stripping colorama wrapper. That is exactly what we checked.
- Check further if your input goes beyond our sample: the limit quoted above comes from the project itself.
- Check further if you need it on Windows: this record covers Ubuntu 26.04 under WSL2 only.
Questions this test answers
Does Colorama strip ANSI color codes?
In our test, yes. All 4 codes in the input were removed and the 40 bytes left matched the input text exactly.
Did we test Colorama on Windows?
No. This record ran on Ubuntu 26.04 under WSL2. It does not show how Colorama behaves in a Windows console.
Which version did we test, and when?
Colorama 0.4.6, on (UTC).
Did the test need internet access?
No. The sandbox had networking switched off for the whole run.
What does Colorama not handle?
Our single input does not probe this. The project names its own limit, quoted under Limits of this test; inputs like that need their own test.
Test records
Each test keeps the code shown in its video. Code CLRMSK leads here; you can also search any code on Find a code.
| Code | Tested | Version | Platform | Result |
|---|---|---|---|---|
| CLRMSK | 0.4.6 | Ubuntu 26.04 under WSL2 | ANSI codes removed, text unchanged |
Official links
License and attribution
- BSD-3-Clause — colorama by Jonathan Hartley (BSD-3-Clause)
Rights holder: Jonathan Hartley. Permission: use_modify_distribute License source ↗ - LicenseRef-RepoProof-Owned — RepoProof
Rights holder: RepoProof. Permission: use_modify_distribute License source ↗
Covers 5 assets: demo input, demo output, demo recording, input frame, output frame.
Production note
AI-assisted script and synthetic narration; demo recorded by our automated test workflow.
Page text is assembled from the recorded test data. Sentences taken from the tool's README are marked as quotes.