From 7869917a8b057b246bb32b8e39a2f96d71d816b9 Mon Sep 17 00:00:00 2001 From: Sandipsinh Dilipsinh Rathod <62684960+ssddOnTop@users.noreply.github.com> Date: Sat, 14 Mar 2026 18:17:21 -0400 Subject: [PATCH 1/2] fix(zsh): use .send-break to avoid stale cursor redraw on reset --- shell-plugin/lib/helpers.zsh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/shell-plugin/lib/helpers.zsh b/shell-plugin/lib/helpers.zsh index 55fb7016e9..f63924edd6 100644 --- a/shell-plugin/lib/helpers.zsh +++ b/shell-plugin/lib/helpers.zsh @@ -42,9 +42,20 @@ function _forge_reset() { # Clear buffer and reset cursor position BUFFER="" CURSOR=0 - # Force widget redraw and prompt reset - zle -I - zle reset-prompt + # Use the builtin .send-break to end the ZLE edit cycle without printing + # the buffer or adding a visible blank line. + # + # .send-break (Ctrl+G) aborts the current line editor, clears the buffer, + # and triggers a fresh prompt cycle at the current terminal cursor position. + # Unlike .accept-line (which prints an empty buffer + newline, producing a + # visible blank line), .send-break cleanly transitions to the new prompt. + # + # We must NOT use `zle reset-prompt` here because it redraws at the + # position where ZLE *thinks* the cursor is -- which is stale after + # _forge_exec_interactive wrote output directly to /dev/tty (bypassing + # ZLE's cursor tracking). That stale redraw overwrites the last few + # lines of output. + zle .send-break } From c5d1d4e270319bcec85fae0f60adbd0d00c1c997 Mon Sep 17 00:00:00 2001 From: Sandipsinh Dilipsinh Rathod <62684960+ssddOnTop@users.noreply.github.com> Date: Sat, 14 Mar 2026 22:57:28 -0400 Subject: [PATCH 2/2] fix(zsh): use .accept-line instead of .send-break in forge reset --- shell-plugin/lib/helpers.zsh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/shell-plugin/lib/helpers.zsh b/shell-plugin/lib/helpers.zsh index f63924edd6..5bc74a8f0f 100644 --- a/shell-plugin/lib/helpers.zsh +++ b/shell-plugin/lib/helpers.zsh @@ -42,20 +42,8 @@ function _forge_reset() { # Clear buffer and reset cursor position BUFFER="" CURSOR=0 - # Use the builtin .send-break to end the ZLE edit cycle without printing - # the buffer or adding a visible blank line. - # - # .send-break (Ctrl+G) aborts the current line editor, clears the buffer, - # and triggers a fresh prompt cycle at the current terminal cursor position. - # Unlike .accept-line (which prints an empty buffer + newline, producing a - # visible blank line), .send-break cleanly transitions to the new prompt. - # - # We must NOT use `zle reset-prompt` here because it redraws at the - # position where ZLE *thinks* the cursor is -- which is stale after - # _forge_exec_interactive wrote output directly to /dev/tty (bypassing - # ZLE's cursor tracking). That stale redraw overwrites the last few - # lines of output. - zle .send-break + + zle .accept-line }