Skip to content

Commit 676067d

Browse files
committed
Added README
1 parent 58985d5 commit 676067d

3 files changed

Lines changed: 28 additions & 0 deletions

File tree

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# RunWithColor
2+
3+
[![GitHub Licence Badge](https://img.shields.io/github/license/Rephidock/Rephidock.CLI.RunWithColor)](https://github.com/Rephidock/Rephidock.CLI.RunWithColor/blob/main/LICENSE)
4+
5+
A CLI utility to enable ANSI escape sequences in windows command prompt (cmd, conhost).
6+
7+
## About
8+
9+
By default the command prompt treats ANSI escape sequences as text, hence why they visibly appear.
10+
11+
For the escape sequences to be treated as actions the program running can enable `ENABLE_VIRTUAL_TERMINAL_PROCESSING` flag during execution, however some programs do not.
12+
13+
This tool is a workaround that enables that flag for them.
14+
15+
## Example
16+
17+
In this example the project was built as a single executable, renamed to `runwithcolor.exe` and added to PATH.
18+
19+
The following [python code](src/hello_world_in_green.py) is run in the terminal:
20+
```py
21+
print("\x1b[32mHello World! (but in green)\x1b[0m")
22+
```
23+
24+
Normal execution:
25+
![image: example_execution_before](media/example_execution_before.png)
26+
27+
Execution using the tool:
28+
![image: example_execution_after](media/example_execution_after.png)

media/example_execution_after.png

4.17 KB
Loading

media/example_execution_before.png

4.11 KB
Loading

0 commit comments

Comments
 (0)