sharkdp / hexyl

A command-line hex viewer
Apache License 2.0
8.93k stars 227 forks source link

Some colors are printed even if they're disabled #63

Closed tbu- closed 5 years ago

tbu- commented 5 years ago
$ printf "%32s" "" | hexyl --border none --color never
 00000000  20 20 20 20 20 20 20 20   20 20 20 20 20 20 20 20                    
 *                                                                              
 00000020                                                                       
$ printf "%32s" "" | hexyl --border none --color never | hexdump -C
00000000  20 30 30 30 30 30 30 30  30 20 20 32 30 20 32 30  | 00000000  20 20|
00000010  20 32 30 20 32 30 20 32  30 20 32 30 20 32 30 20  | 20 20 20 20 20 |
00000020  32 30 20 20 20 32 30 20  32 30 20 32 30 20 32 30  |20   20 20 20 20|
00000030  20 32 30 20 32 30 20 32  30 20 32 30 20 20 20 20  | 20 20 20 20    |
00000040  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
00000050  0a 20 1b 5b 33 38 3b 35  3b 32 34 32 6d 2a 1b 5b  |. .[38;5;242m*.[|
00000060  30 6d 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |0m              |
00000070  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
000000b0  0a 20 30 30 30 30 30 30  32 30 20 20 20 20 20 20  |. 00000020      |
000000c0  20 20 20 20 20 20 20 20  20 20 20 20 20 20 20 20  |                |
*
00000100  20 0a                                             | .|
00000102

The star is colored even if colors are disabled.

(On another note, would it be possible to make --color=auto the default? That's how most CLI utilities work.)

awidegreen commented 5 years ago

I'll fix that together with #62