Bug 57471 - can not delete character in console
Summary: can not delete character in console
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2017-06-14 09:09 UTC by s2quake
Modified: 2017-09-12 14:12 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description s2quake 2017-06-14 09:09:58 UTC
i want to delete character in console by using write method

here are methods to delete character

Console.Write("\b") or Console.Write("\0");

these methods does not work in mono 

is there a way to delete character?
Comment 1 s2quake 2017-06-14 09:33:47 UTC
Console.Write("\b") work

Console.Write("\0") does not work
Comment 2 s2quake 2017-07-03 04:30:57 UTC

does not delete character '3';

but after using Console.BufferWidth Property, it does work

var text = string.Empty.PadRight(Console.BufferWidth - 1, '1');

and another bug.

after deletion character '3'

selectall and copy text in terminal

paste them to text editor

i think text must be "12"

but result is "12 "

is this right?
Comment 3 Marek Safar 2017-09-12 14:12:37 UTC
`\b` only controls cursor you need to overwrite the character. Following repro works for me as expected

using System;

class X
    public static void Main ()
        Console.Write("\b ");