Fix BackwardKillLine length calculation for multiline input (#5102)

This commit is contained in:
Snowy
2026-03-11 13:23:22 -07:00
committed by GitHub
parent 554035e04f
commit e266ca6f67
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -135,7 +135,7 @@ namespace Microsoft.PowerShell
public static void BackwardKillLine(ConsoleKeyInfo? key = null, object arg = null)
{
var start = GetBeginningOfLinePos(_singleton._current);
_singleton.Kill(start, _singleton._current, true);
_singleton.Kill(start, _singleton._current - start, true);
}
/// <summary>
+2
View File
@@ -119,6 +119,8 @@ namespace Test
PSConsoleReadLine.SetKeyHandler(new[] { "Shift+Tab" }, PSConsoleReadLine.BackwardKillLine, "", "");
Test("", Keys("dir", _.Shift_Tab));
Test("abc\n123", Keys("abc", _.Shift_Enter, "123", _.Shift_Tab, _.Ctrl_y));
}
[SkippableFact]