dotnet / dotnet/core

An exception thrown in dotnet run in Ubuntu will cause the user input echo to be turned off

Open
#8,528 1 comment 0 reactions 0 assignees View on GitHub
Team:Libraries
Dominant language
PowerShell
Stars
22k
Forks
4.9k
Avg merge
5d 3h
Merged PRs (30d)
30

Description

### Description
I recently started to get in touch with Linux development. I found that when Console.ReadLine is called, throwing any exception within a short period of time and closing the program will cause the user input echo to crash. The terminal cannot display any input from the user, and the terminal response is also output in wrong position.

### Configuration
dotnet 7.0.203
ubuntu 22.04.2

### Regression?
simple to run this code with "dotnet run":
```cs
var result = Console.ReadLine();
Console.WriteLine(result ?? string.Empty);
throw new Exception("debug fatal error");
```

### Other information
Running a compiled file will not cause this issue.
Only when running 'dotnet run', other instructions are not tested.
There is no such issue in Windows.
I only tested Ubuntu and Windows.

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.