Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape characters in error messages #5810

Closed
moozzyk opened this issue Apr 19, 2016 · 12 comments
Closed

Escape characters in error messages #5810

moozzyk opened this issue Apr 19, 2016 · 12 comments
Milestone

Comments

@moozzyk
Copy link
Contributor

moozzyk commented Apr 19, 2016

Steps to reproduce

PS C:\Users\\Documents\Visual Studio 2015\Projects\dotnet-scratch> dotnet my-tool
�[1m�[31mNo executable found matching command "dotnet-my-tool"�[39m�[22m

Expected behavior

No �[39m�[22m like sequences in the error message

Actual behavior

�[1m�[31mNo executable found matching command "dotnet-my-tool"�[39m�[22m

Environment data

dotnet --info output:

dotnet --version
1.0.0-rc2-002426
@brthor
Copy link
Contributor

brthor commented Apr 19, 2016

what platform

@moozzyk
Copy link
Contributor Author

moozzyk commented Apr 19, 2016

win10

@mikeharder
Copy link
Contributor

I was also seeing this on Windows Server 2012 R2. See dotnet/cli#2609.

@TheRealPiotrP
Copy link
Contributor

Folks, we're not successfully finding a repro for this issue. I've only seen the ANSI color code characters show up when i redirect console output to a text file and then open that file in notepad. We've tried this on multiple win10 machines. Can you help us find a good repro?

@mikeharder
Copy link
Contributor

mikeharder commented Apr 22, 2016

Repro Steps

  1. Create a VM in Azure running Windows Server 2012 R2 Datacenter
  2. Install "Windows x64 .NET Core SDK Installer" version 1.0.0-rc2-002470
  3. Open command prompt (cmd.exe)
  4. Run dotnet foo

Output

C:\Windows\system32>dotnet foo
←[1m←[31mNo executable found matching command "dotnet-foo"←[39m←[22m

@moozzyk
Copy link
Contributor Author

moozzyk commented Apr 22, 2016

I don't see it happening anymore with 1.0.0-rc2-002476

@mikeharder
Copy link
Contributor

Still repros on Windows Server 2012 R2 with 1.0.0-rc2-002476.

@xied75
Copy link

xied75 commented Apr 30, 2016

Just saw this on Ubuntu 14.04 running inside docker:

image

(sorry about the huge size, apparently it's the OneNote screen clipping not handling HiDPI correctly)

It's not really unicode, it's just an plain old ascii 0x1b, as proved like this:

root@c488baa8e6b9:~/test# dotnet run | hd
00000000  43 6f 6d 70 69 6c 69 6e  67 20 1b 74 65 73 74 1b  |Compiling .test.|
00000010  20 66 6f 72 20 1b 44 4e  58 43 6f 72 65 2c 56 65  | for .DNXCore,Ve|
00000020  72 73 69 6f 6e 3d 76 35  2e 30 1b 0a 0a 1b 43 6f  |rsion=v5.0....Co|
00000030  6d 70 69 6c 61 74 69 6f  6e 20 73 75 63 63 65 65  |mpilation succee|
00000040  64 65 64 2e 1b 0a 20 20  20 20 30 20 57 61 72 6e  |ded...    0 Warn|
00000050  69 6e 67 28 73 29 0a 20  20 20 20 30 20 45 72 72  |ing(s).    0 Err|
00000060  6f 72 28 73 29 0a 0a 54  69 6d 65 20 65 6c 61 70  |or(s)..Time elap|
00000070  73 65 64 20 30 30 3a 30  30 3a 30 31 2e 34 38 34  |sed 00:00:01.484|
00000080  35 31 34 38 0a 20 0a 0a  48 65 6c 6c 6f 20 57 6f  |5148. ..Hello Wo|
00000090  72 6c 64 21 0a                                    |rld!.|

@moozzyk
Copy link
Contributor Author

moozzyk commented May 4, 2016

For whatever reason I did not see this with 1.0.0-rc2-002476 but it is actually still happening on Win10 and 1.0.0-rc2-002655:

PS C:\temp\publishout> dotnet pu
�[1m�[31mNo executable found matching command "dotnet-pu"�[39m�[22m

@ghost
Copy link

ghost commented Aug 6, 2016

I can't reproduce it with 1.0.0-preview2-003121 on Windows 10 and OSX 10.11.

@xied75
Copy link

xied75 commented Sep 16, 2016

Running on Linux container works fine now. Maybe can close.

@blackdwarf
Copy link

OK, since it seems the issue has resolved with newer versions, closing. Please reopen if it repros again with latest.

wli3 referenced this issue in wli3/cli Nov 14, 2018
Update latest build status badge and link
@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@msftgits msftgits added this to the 1.0.0-rtm milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants