Open markpattison opened 5 years ago
It looks like the terminal isn't supporting colours for some reason. Not sure why maybe a Windows 7 thing? To work around set --colours 0.
The terminal colours do work from FAKE though...
It must not support ANSI colours and FAKE is using Console.ForegroundColor instead.
Colours are a bit of a pain to support and why we had to put in the --colours option. We could put in and option to use Console colours but they are not atomic and end up with bugs were the colour isn't reset correctly at the end.
I would much prefer the check if it's a TTY or "is this Windows", or even "is this running on a super-old Windows". But I don't believe in mutilating the output of this library just so that a decade old operating system can avoid the above issues; especially since you @markpattison could install ANSI colours https://github.com/adoxa/ansicon and have it working.
See https://github.com/haf/expecto/issues/315 for more discussions.
@haf It's such a mess and so difficult to test. I fear checking TTY takes us further down the rabbit hole. It would be good to have a solid example of covering multiple platforms and consoles.
@AnthonyLloyd Perhaps then we start with https://docs.microsoft.com/en-us/dotnet/api/system.operatingsystem?view=netframework-4.8 ? Windows can default to 0 colours, otherwise 256?
Same issue in full Visual Studio plugin, makes it unusable :(
@Lanayx use --colours 0 if that's possible via the plugin
@AnthonyLloyd Unfortunately there is no such option there
By the way, I have the same issue as topic starter when running dotnet test
on windows 10 in regular console
UPD: Also tried dotnet test -- --colours 0
, no effect
@Lanayx I think you need to raise with adamchester/expecto-adapter maybe they should offer config or just set to --colours 0 if VS doesn't support colours. For dotnet test it would be YoloDev/YoloDev.Expecto.TestSdk.
There's also a stacktrace from Expecto itself that make it difficult to read. E.g.:
at Expecto.Impl.execTestAsync@692-1.Invoke(Unit unitVar)
at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 398
at <StartupCode$FSharp-Core>.$Async.StartChild@1650-5.Invoke(AsyncActivation`1 ctxt) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 1650
at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in E:\A\_work\130\s\src\fsharp\FSharp.Core\async.fs:line 109
As mentaioned by @haf https://github.com/haf/expecto/issues/331#issuecomment-507163272 ANSICON working fine for me.
{
....
"terminal.integrated.shell.windows": "C:\\Program Files\\ANSICON\\x64\\ansicon.exe",
"terminal.integrated.shellArgs.windows": [
"C:\\Program Files\\Git\\bin\\sh.exe",
"--login",
"-i"
]
}
Using VSCode 1.35.1 on Windows 7 with Ionide 4.0.0.
The same issue happens with
cmd
orpowershell
terminal options.To reproduce:
Actual output (sample):
Expected output:
Something like
.