Revert "Ignoring backspace for empty lines on stdin/stdout mode (#8196)" (#8239)

This reverts commit b525b1f0bd.
This commit is contained in:
Travis Plunk
2018-11-12 13:14:04 -08:00
committed by Aditya Patwardhan
parent 655b8b614c
commit db60f0614a
2 changed files with 1 additions and 20 deletions
@@ -1365,14 +1365,7 @@ namespace Microsoft.PowerShell
}
var c = unchecked((char)inC);
if (c == '\b' && !NoPrompt && sb.Length == 0)
{
continue;
}
if (!NoPrompt)
{
Console.Out.Write(c);
}
if (!NoPrompt) Console.Out.Write(c);
if (c == '\r')
{
@@ -476,18 +476,6 @@ foo
$process.StandardOutput.ReadToEnd() | Should -Be "PS> "
EnsureChildHasExited $process
}
It "Redirected input and sending backspace" {
# This test is for issue #8193, in which a backspace at the beginning of a command crashes powershell
$si = NewProcessStartInfo "-noprofile -nologo" -RedirectStdIn
$process = RunPowerShell $si
$process.StandardInput.Write("`$function:prompt = { 'PS> ' }`n")
$null = $process.StandardOutput.ReadLine()
$process.StandardInput.Write("`bexit`n")
$process.StandardOutput.ReadLine() | Should -Be "PS> exit"
$process.StandardInput.Close()
EnsureChildHasExited $process
}
}
Context "Exception handling" {