From 93af4083ae7954f7ab2f41ffca2871ec9fd9fc60 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 11:45:06 +0000 Subject: [PATCH 1/2] Initial plan From 556a6edce5aa600fb5c4c04737fa48315f4f2757 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Feb 2026 11:50:06 +0000 Subject: [PATCH 2/2] Fix ArgumentOutOfRangeException at SetCursorPosition when console is resized Co-authored-by: shibayan <1356444+shibayan@users.noreply.github.com> --- Sharprompt/Drivers/DefaultConsoleDriver.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sharprompt/Drivers/DefaultConsoleDriver.cs b/Sharprompt/Drivers/DefaultConsoleDriver.cs index 3da5577..ab1df34 100644 --- a/Sharprompt/Drivers/DefaultConsoleDriver.cs +++ b/Sharprompt/Drivers/DefaultConsoleDriver.cs @@ -93,7 +93,9 @@ public void Write(string value, ConsoleColor color) public void WriteLine() => Console.WriteLine(); - public void SetCursorPosition(int left, int top) => Console.SetCursorPosition(left, top); + public void SetCursorPosition(int left, int top) => Console.SetCursorPosition( + Math.Clamp(left, 0, Console.BufferWidth - 1), + Math.Clamp(top, 0, Console.BufferHeight - 1)); public bool KeyAvailable => Console.KeyAvailable;