adoxa / ansicon

Process ANSI escape sequences for Windows console programs.
http://ansicon.adoxa.vze.com/
Other
1.23k stars 130 forks source link

color don't change #134

Open Kobe972 opened 2 years ago

Kobe972 commented 2 years ago

It can't change the color. i.e., [...m has no effect. Win10 x64.

adoxa commented 2 years ago

You're going to need to be way more specific. Colour is tricky to demonstrate via copy/paste, so assuming nothing's working I'll demonstrate with move cursor right:

C:\Projects\ansicon>ver

Microsoft Windows [Version 10.0.19041.388]

C:\Projects\ansicon>ansicon --version
ANSICON (64-bit) version 1.89 (29 April, 2019).

C:\Projects\ansicon>ansicon -e ^[[4Cmove right
    move right

C:\Projects\ansicon>echo %ANSICON_VER%
189

C:\Projects\ansicon>echo ^[[4Cmove right
    move right
acuna-public commented 2 years ago

I've the same problem too

C:\Windows\System32>ver

Microsoft Windows [Version 6.1.7601]

C:\Windows\System32>ansicon --version
ANSICON (64-bit) version 1.89 (29 April, 2019)
adoxa commented 2 years ago

Which gives me the same problem: lack of detail - all I can tell from that is you're using 64-bit Win7 and either ansicon is in the PATH or you've installed to system32 (bad idea). Does ansicon -e work? Did it install? Is it cmd that's not working, or some other program?

acuna-public commented 2 years ago

Hello, ansicon -e show nothing and didn't help( And yes, it's only cmd till.

adoxa commented 2 years ago

Does ansicon -e ^[[4Ctest (where ^[ is the escape character, Ctrl+[) show     test (i.e. four spaces before test)?

acuna-public commented 2 years ago

No, it's not. But it's worked before I've bought another SSD and change its letter, I've even search somethig according with ansicon in regedit and found only its path in Path variable (which is correct). Will be glad it can be helpful.

adoxa commented 2 years ago

Do a log and send me the output. Here's mine.

C:\>ansicon -l5 -e ^[[4Ctest
    test

C:\>type %temp%\ansicon.log
ANSICON (64-bit) v1.89 log (5) started 2022-03-15 9:59:44

ansicon (11144): WriteConsoleW: 3 "\e[m"
ansicon (11144): WriteConsoleW: 8 "\e[4Ctest"
ansicon (11144): WriteConsoleW: 1 "\n"
ansicon (11144): Primary thread detached, exiting process
ansicon (11144): Terminating
acuna-public commented 2 years ago

I'm so sorry, was busy this days. I forgot to run ansicon -i. But I don't remember that I did it before. But okay, seems I forgot about it, thanks for awesome project... Can I ask you, why does anybody use it on another versions of Windows, because as I know Windows 10 support colors out of the box.

adoxa commented 2 years ago

Windows 10 doesn't quite support colors out of the box - programs must still enable the terminal sequences.

blackcrack commented 2 years ago

@acuna-public , a lil tip, make a bat/.cmd file for this task and then do you need only kick on the script-file and all is done what's with ansicon have to do...

@adoxa , Jason, could you onclude the WinNT 10/11 colorcode into ansicon, or it is not other ? (should i make a new issue?) and the Hex-colors, it is give the possible for transparency in %, so these not only 6 digits, be now ?7? should be make more enhanced and supports that.. because, if taked code from a html5 page in hex-color

adoxa commented 2 years ago

I did actually make a start on passing through SGR sequences, but got sidetracked and never went back to it. Bit busy atm, but I'll get there...

acuna-public commented 2 years ago

@adoxa yes, but is sequences only one way to get colors in cmd, or I've missed something?

acuna-public commented 2 years ago

@blackcrack thank you, all is working without it, I've simply forgot to call ansicon -i.

adoxa commented 2 years ago

@adoxa yes, but is sequences only one way to get colors in cmd, or I've missed something?

I'm not sure what you're asking. If you want, e.g. cmd's echo command to have colors, then yes, sequences are the only way (well, apart from patching/hooking cmd itself and directly modifying the echo command to support colors in some way). If you want a batch file to have colored output then there are a variety of external tools to do that.