colored icon indicating copy to clipboard operation
colored copied to clipboard

Not working on windows

Open sk-Prime opened this issue 6 years ago • 12 comments

It is showing numbers rather than color. in this case blue Capture

Though i have added control::set_virtual_terminal(true); in my source file. Capture

sk-Prime avatar Aug 03 '19 10:08 sk-Prime

Hi @sk-Prime,

What version of Windows are you running? Which console?

I believe the virtual terminal sequence support is only available in Windows 10.

kurtlawrence avatar Aug 14 '19 04:08 kurtlawrence

in windows seven it doesn't work. but colour crate perfectly works. but i liked colored approach.

sk-Prime avatar Aug 29 '19 13:08 sk-Prime

Yes, I can confirm it doesn't work on windows. Could this be mentioned in the README until it's fixed ?

lovasoa avatar Mar 30 '20 18:03 lovasoa

im using Windows 10 with devmode on. doesnt work on Windows Terminal neither on CMD.

steelx avatar Apr 27 '20 06:04 steelx

Same issue. Both in cmd and PowerShell. Fresh Windows 10 installation.

timvisee avatar Feb 05 '21 16:02 timvisee

Hi all,

Could you please provide details about your OS, what shell/terminal you are using, an example of your code that does not work and a screenshot with the output showing it not working. Even the Rust toolchain you are using could be the issue.

I ask for this information as I am unable to reproduce on my machine, and in my experience with Rust production code, running on many machines (all Windows 10) that use colored there have been no issues when using the set_virtual_terminal flag.

kurtlawrence avatar Feb 06 '21 07:02 kurtlawrence

It works for me in the Command Prompt and Powershell. Windows 10.0.19042.928.

image

Timmmm avatar May 02 '21 20:05 Timmmm

I have encountered the same issue. When I run "cargo run" while developing, it works perfectly, even with cmd.exe. However, with the compiled binary, whether debug or release mode, whether cmd or powershell, the control chars are displayed instead of color.

constituent avatar Jul 12 '21 04:07 constituent

Oh I think I find the answer. As the doc of ansi_term suggests, On Windows 10, the application must enable ANSI support first: let enabled = ansi_term::enable_ansi_support();

constituent avatar Jul 12 '21 04:07 constituent

Oh I think I find the answer. As the doc of ansi_term suggests, On Windows 10, the application must enable ANSI support first: let enabled = ansi_term::enable_ansi_support();

@constituent did you try using https://docs.rs/colored/2.0.0/x86_64-pc-windows-msvc/colored/control/fn.set_virtual_terminal.html?

kurtlawrence avatar Oct 29 '21 02:10 kurtlawrence

Oh I think I find the answer. As the doc of ansi_term suggests, On Windows 10, the application must enable ANSI support first: let enabled = ansi_term::enable_ansi_support();

@constituent did you try using https://docs.rs/colored/2.0.0/x86_64-pc-windows-msvc/colored/control/fn.set_virtual_terminal.html?

I can't quite remember, but probably not And as I tried just now, set_virtual_terminal works as fine as ansi_term::enable_ansi_support for me

constituent avatar Oct 29 '21 02:10 constituent