dotnet/runtime

Setting Console.TreatControlCAsInput to true causes text to be removable

Open

#44,667 建立於 2020年11月13日

在 GitHub 查看
 (4 留言) (0 反應) (0 負責人)C# (5,445 fork)batch import
area-System.Consolebughelp wantedos-windows

倉庫指標

Star
 (17,886 star)
PR 合併指標
 (平均合併 12天 11小時) (30 天內合併 661 個 PR)

描述

This issue has been moved from a ticket on Developer Community.


For some reason, setting Console.TreatControlCAsInput to 'true' causes text printed with "Console.Write" to be removable. To reproduce, simply create a new Console application and paste the following code in the main method:

//Console.TreatControlCAsInput = true; Console.Write("Test> "); while (true) Console.Read();

Start the application (with the first line commented) and write some input. Then hold down backspace; the text should remove until the end of "Test> " and you aren't able to remove more characters. Now uncomment the first line and start the application again. Write some input and hold down backspace; for some reason now every text is removed with backspace, even what was printed with Console.Write.


Original Comments

Feedback Bot on 5/21/2020, 03:45 AM:

Feedback Bot on 7/2/2020, 11:17 PM:

I have detected that for the last 35 days, this issue didn't have much product team activity and a very small amount of new votes or comments. Based on this, its severity, and affected area, it’s my experience that this issue is very unlikely to be fixed.

Dada Huo [MSFT] on 11/3/2020, 00:38 AM:

Full Name on 11/10/2020, 04:27 AM:

(private comment, text removed)


Original Solutions

(no solutions)

貢獻者指南