CLI option to disable ANSI formatting
See original GitHub issuePR #29 added bold formatting on input words:
This is cool 😎 but not always desired, for example when piping to a file:
Flag to disable ANSI could be -p
(--plaintext
), e.g.
parser.add_argument("-p", "--plaintext",
help="output plaintext, disabling ANSI formatting",
action="store_true")
ANSI codes could be replaced with a library such as kennethreitz/crayons, which supports disabling colours etc. without too much extra code:
if args.plaintext:
crayons.disable()
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
NO_COLOR: disabling ANSI color output in various Unix ...
Software Description Date/Version Supported
alogview Android logcat Filter 2018‑10‑31
Ammonite Scala Scripting 2017‑07‑03 / 1.0.0
Ansible IT automation system 2021‑04‑26 / 2.11.0
Read more >3 Methods to Disable ANSI Color Escape Codes for ... - Lindevs
Method 1 - no-ansi option. In order to disable ANSI color escape codes, we can add the --no-ansi option when executing a command....
Read more >Automatically disable ansi in non-interactive shells · Issue #1417
New feature Generally, big ❤️ to ansi logging. However, in non-interactive terminals, it is a bit of a mess and very difficult to...
Read more >Windows console with ANSI colors handling - Super User
Create a DWORD key (if necessary) and set its value to 1 to globally enable (or 0 to disable`) ANSI processing by default....
Read more >How to disable color output of "ng build"? - Stack Overflow
I was unable to find --no-color option to disable ANSI characters into angular-cli output.. Anyway you could remove progress output with ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d suggest timofurrer/colorful. It seems to have better windows support.
Also, I think both crayons and colorful disable ANSI when piping.
ANSI replaced with colorful in 583ca75ebc1c388d87b86dc62260af401a66e840