Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Bug dotnet watch run in TakeCommand with a tcc or cmd prompt

Nov
5
0
When using 'dotnet watch run' in tcc or cmd tab, hot reloads progressively places the first character(s) from the next line at the right margin.

1669307665825.png


You can work around this by disabliing dotnet watch emojis via an environment variable:

DOTNET_WATCH_SUPPRESS_EMOJIS=1
 
dotnet watch run

Microsoft .NET development, allows hot-reloading during development.

It's happens in the take command tabbed interface, I've tried both

tcmd /t tcc
tcmd /t cmd
 
With tcc in a cmd window it renders the text correctly, but block characters for the emojis, I suspect that's more to do with cmd.

Not a show-stopper but thought you should be aware.
 
For more info on dotnet, visit dotnet command - .NET CLI

For example, create a new folder, and from the command line in the new folder;
Code:
dotnet new console --framework net6.0
to create a new C# Project.

To run the project;
Code:
E:\...\test>dotnet run test.csproj
Hello, World!

To build the project;
Code:
E:\...\test>dotnet build test.csproj
MSBuild version 17.3.2+561848881 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  test -> E:\Documents\csharp\test\bin\Debug\net6.0\test.dll

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:01.72

It saves one the trouble of using Visual Studio to develop simple .NET apps from the command line.

Joe
 
I just tried in a stand-alone TCC.EXE window, and did not have the same problem;
Code:
E:\...\test>dotnet watch
dotnet watch  Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload.
   Press "Ctrl + R" to restart.
dotnet watch  Building...
  Determining projects to restore...
  All projects are up-to-date for restore.
  test -> E:\Documents\csharp\test\bin\Debug\net6.0\test.dll
dotnet watch  Started
Hello, World!
Test
dotnet watch ⌚ Exited
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
dotnet watch  Building...
  test -> E:\Documents\csharp\test\bin\Debug\net6.0\test.dll
dotnet watch  Started
Hello, World!
Test1
dotnet watch ⌚ Exited
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...
dotnet watch  Building...
  test -> E:\Documents\csharp\test\bin\Debug\net6.0\test.dll
dotnet watch  Started
Hello, World!
Test
dotnet watch ⌚ Exited
dotnet watch ⏳ Waiting for a file to change before restarting dotnet...

However, it was lacking in all the emojis;
1669325419537.png


I only get a little clock, no other emojis.

Joe
Code:
     _x64: 1
   _admin: 1
_elevated: 1

TCC  29.00.15 x64   Windows 10 [Version 10.0.19044.2130]
 
Code:
set DOTNET_WATCH_SUPPRESS_EMOJIS=1
...as indicated in the OP, eliminates the emojis.

1669325699977.png


Joe
 
With the .NET SDK 6.0.300 and later, dotnet watch emits non-ASCII characters to the console, as shown in the following example:
1669326305761.png


Joe
 
Take Command tab windows are capable of displaying emojis. jemerson, what do you see if you type echo %@char[0xd83d 0xde38] in a regular Take Command tab?
 
Hmmm! My consoles all use Consolas. TCMD doesn't show a smiley. TCC in conhost also doesn't show a smiley. But TCC in OpenConsole.exe (from Windows Terminal) does. That makes me think the Windows 11 conhost will do it (whereas the Windows 10 conhost won't). Charles, are you in Windows 11?
 
Hmmm! My consoles all use Consolas. TCMD doesn't show a smiley. TCC in conhost also doesn't show a smiley. But TCC in OpenConsole.exe (from Windows Terminal) does. That makes me think the Windows 11 conhost will do it (whereas the Windows 10 conhost won't). Charles, are you in Windows 11?

I'm using Windows 10. But I'm talking specifically about the Take Command tab window. Take Command can display emojis, even if the underlying console just shows a boxed-question-mark character.
 
FYI I am using windows 11 and have Windows Terminal installed. Font is Consolas in all settings for both tcmd and terminal.

I see that setting up a tcc prompt within windows terminal does show the emojis in color. Switch terminal to use conhost.exe shows them in grayscale, but without the problem of printing the first characters of the next ine.

In TC you use dotnet watch run and make a change to cause a hot reload and ctrl+c to stop the session. You will see that the prompt now has leading space between the path> and cursor dependent on how many characters have been mis-placed.

Typing at this point inserts text immediately after the test> but the cursor is off to the right.

C:\Scratch\tc\tctest> _
C:\Scratch\tc\test\>g _
C:\Scratch\tc\test\>gi _
C:\Scratch\tc\test\>git _
C:\Scratch\tc\test\>git _
C:\Scratch\tc\test\>git s _
...

Here I've created a dotnet new console application and initialized it as a git repository to illustrate that the effect outlasts the dotnet watch run command.

Under dotnet watch run I made several changes to cause a hot reload.
then 'git status' and 'git add' and 'git status' again.


1669391646778.png



Again, for me this is not a show stopper, using tcstart.cmd to set DOTNET_WATCH_SUPPRESS_EMOJIS=1 gets around this problem. A simple : placeholder appears instead of a graphic.
 
The font has something to do with it. I can get the cat emoji in TCMD with Lucida Console and not with Consolas. I'm on Windows 10 but just updated to 10.0.19045.2251 (2009, 22H2).
 
Back
Top
[FOX] Ultimate Translator
Translate