dotnet / dotnet/aspnetcore

Strange console output format after code changes when using "dotnet watch run"

Open
#39,282 5 comments 0 reactions 0 assignees View on GitHub
area-commandlinetools feature-hot-reload investigate
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Describe the bug
The console output becomes strange after code changed when using `dotnet watch run`.
- The log was not aligned to the beginning of the row.
- Cannot use `Ctrl+C` to exit the watch process

### To Reproduce
```
mkdir SampleProject
cd SampleProject
dotnet new webapi
dotnet watch run
```
Change some code, and save.
The console output becomes something like below:

![image](https://user-images.githubusercontent.com/455630/147729877-e03034d9-8d73-4082-963d-9d40b7e69c5c.png)

### Further technical details
```
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a

Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/

Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc

.NET SDKs installed:
5.0.403 [/usr/share/dotnet/sdk]
6.0.101 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.12 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.