diff --git a/PSReadLine/KillYank.cs b/PSReadLine/KillYank.cs index 77fe33f..c282b14 100644 --- a/PSReadLine/KillYank.cs +++ b/PSReadLine/KillYank.cs @@ -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); } /// diff --git a/test/KillYankTest.cs b/test/KillYankTest.cs index 381e788..5c631d5 100644 --- a/test/KillYankTest.cs +++ b/test/KillYankTest.cs @@ -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]