Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

[1.0.1] Fix color output in command prompt #273

Merged
merged 1 commit into from
Apr 11, 2017
Merged

Conversation

natemcmaster
Copy link
Contributor

Backport #268 to 1.0.1

Resolves #271

NB: this is merging to "namc/rel/1.0.1". If approved, I'll rename that branch to "rel/1.0.1" and rebase this PR to merge into that branch.

@@ -15,5 +15,7 @@ public interface IConsole
bool IsInputRedirected { get; }
bool IsOutputRedirected { get; }
bool IsErrorRedirected { get; }
ConsoleColor ForegroundColor { get; set; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I don't recall exactly, but I think at one point we said we wanted patches to be 100% binary compatible, which means that no "public" breaking change can happen at all, even in .Internal namespaces. Is there a way to make this change without breaking any API surface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this guidance applies to command line tools. Users never reference any of the assemblies produced in this repo -- they are all DotNetCliToolReference packages -- so breaking changes shouldn't matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, very good point! Looks like no "regular" NuGet packages are built from this repo, so presumably no one ever references anything here as a DLL reference.

@natemcmaster
Copy link
Contributor Author

Is this approved as in merge to rel/1.0.1? Or do we still need DJ approval?

@Eilon
Copy link
Member

Eilon commented Mar 15, 2017

Still needs official approval. Only merge into the rel/1.0.x branch when the bug gets marked as patch-approved. The full patch process is described here: Patch fix approval process

@shanselman
Copy link
Contributor

Is this going to happen soon?

@snerks
Copy link

snerks commented Mar 27, 2017

Is it expected that this fix will work on Windows 7 (SP1) 64-bit?

@natemcmaster
Copy link
Contributor Author

Still pending approval. It fixes Command Prompt color, which should mean Win 7 is fixed. The dev branch already has this fix. You can take the fix for a test drive by using our nightly feeds.

@snerks
Copy link

snerks commented Mar 27, 2017

@natemcmaster - thanks. The steps I took were:

Download ZIP of latest Windows X64 SDK:
https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-dev-win-x64.latest.zip

Unzip the file. Place the contents of the unzipped dotnet-dev-win-x64.latest folder in the test project folder in the source code (i.e. the mytests folder, described in the blog post written by @shanselman) :
https://www.hanselman.com/blog/CommandLineUsingDotnetWatchTestForContinuousTestingWithNETCore10AndXUnitnet.aspx

Open a command line (cmd.exe)
Navigate to the mytests folder

Type dotnet --version
2.0.0-preview1-005660

Type dotnet test

Expected result:
Colorised output

Actual result:
All output is white text

Note: I'm also seeing character-encoding issues in cmd.exe (and Powershell) but not Git-Bash, similar to the issue #265.

It's possible I have missed some necessary steps.

@natemcmaster
Copy link
Contributor Author

@snerks I'm not sure what you're trying to do. I didn't see mention of dotnet-watch anywhere in your repro steps. This PR is only about changes to dotnet-watch, not dotnet-test. Consider opening an issue instead of commenting on this PR if you're having trouble using our nightly builds.

@snerks
Copy link

snerks commented Mar 27, 2017

@natemcmaster - I've moved the comment to #265 and tried to clarify the steps, to show usage of dotnet-watch.

@shanselman
Copy link
Contributor

Let me know if you want to pair on this @natemcmaster. The issue is that when we do "dotnet watch SOMETHING" the colors are not used, as in "dotnet watch test"

@natemcmaster
Copy link
Contributor Author

@shanselman It sounds like there are two overlapping things being discussed. (1) the color dotnet-watch produces (2) the color dotnet-test produces when run by dotnet-watch. This PR (and issue #265) only address (1). Can you open a separate issue for (2)?

@shanselman
Copy link
Contributor

@natemcmaster I don't think dotnet test produces color. So I think you've fixed it with #265 (comment) right?

@natemcmaster
Copy link
Contributor Author

I don't think dotnet test produces color

Not yet ;) microsoft/vstest#641.

Was just making sure we were talking about the same thing. Yes, #265 is resolved. This is the only color output issue I'm aware of. If you find others, feel free to open a new issue.

@shanselman
Copy link
Contributor

OK, cool. We should just watch out/make sure that when it does, everything works as it should on cmd.exe and powershell.exe.

@natemcmaster natemcmaster added the blocked Blocked label Mar 29, 2017
@natemcmaster natemcmaster removed the blocked Blocked label Apr 11, 2017
@natemcmaster natemcmaster changed the base branch from namc/rel/1.0.1 to rel/1.0.1 April 11, 2017 21:35
@natemcmaster
Copy link
Contributor Author

FYI 1.0.1 is now available on NuGet.org.

https://www.nuget.org/packages/Microsoft.DotNet.Watcher.Tools/1.0.1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants