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

Nov 24, 2022
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
 
Nov 24, 2022
5
0
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
 
Nov 24, 2022
5
0
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]
 
May 20, 2008
12,049
128
Syracuse, NY, USA
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?
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
4,641
101
Albuquerque, NM
prospero.unm.edu
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.
 
Nov 24, 2022
5
0
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.
 
May 20, 2008
12,049
128
Syracuse, NY, USA
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).
 

Similar threads