Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions shell-plugin/lib/helpers.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ function _forge_reset() {
# Clear buffer and reset cursor position
BUFFER=""
CURSOR=0
# Force widget redraw and prompt reset
zle -I
zle reset-prompt

zle .accept-line
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation does not match the PR description. The code calls zle .accept-line but the description explicitly states the fix should use zle .send-break. These are fundamentally different ZLE widgets:

  • .accept-line (Enter key) accepts and executes the current line
  • .send-break (Ctrl+G) aborts the current edit cycle and starts fresh

The description's rationale is that .send-break "aborts the current ZLE edit cycle and triggers a fresh prompt cycle at the actual terminal cursor pos", which is the intended behavior. Using .accept-line instead will execute the empty buffer (after BUFFER="") rather than aborting the edit cycle, which may not properly reset the prompt at the correct cursor position.

Fix:

zle .send-break
Suggested change
zle .accept-line
zle .send-break

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

}


Expand Down
Loading