https://github.com/rephidock/rephidock.cli.runwithcolor
CLI utility to enable ansi escape sequences in cmd (conhost)
https://github.com/rephidock/rephidock.cli.runwithcolor
ansi-sequences cli cmd conhost console console-colors windows
Last synced: about 2 months ago
JSON representation
CLI utility to enable ansi escape sequences in cmd (conhost)
- Host: GitHub
- URL: https://github.com/rephidock/rephidock.cli.runwithcolor
- Owner: Rephidock
- License: unlicense
- Created: 2024-01-18T15:22:44.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-18T16:37:19.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T10:27:23.327Z (11 months ago)
- Topics: ansi-sequences, cli, cmd, conhost, console, console-colors, windows
- Language: C#
- Homepage:
- Size: 17.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RunWithColor
[](https://github.com/Rephidock/Rephidock.CLI.RunWithColor/blob/main/LICENSE)
A CLI utility to enable ANSI escape sequences in windows command prompt (cmd, conhost).
## About
By default the command prompt treats ANSI escape sequences as text, hence why they visibly appear.
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.
This tool is a workaround that enables that flag for them.
*The name of the tool comes from the wide use of the escape sequences to color text.*
## Example
In this example the project was built as a single executable, renamed to `runwithcolor.exe` and added to PATH.
The following [python code](src/hello_world_in_green.py) is run in the terminal:
```py
print("\x1b[32mHello World! (but in green)\x1b[0m")
```
Normal execution:

Execution using the tool:
