fix(zsh): stop the prompt redraw from clobbering action output
Fixes #3468.
The zsh integration clips the last lines of a response on kitty + p10k. _forge_reset runs after the output is already on the tty, but ZLE still has the cursor on the old prompt row, so zle reset-prompt redraws the prompt over it and the response looks cut off.
Buffer is always empty in _forge_reset, so accepting the empty line gives a clean prompt below the output:
function _forge_reset() {
BUFFER=""
CURSOR=0
zle .accept-line
}
Left the other reset-prompt callers (suggest/commit-preview/completion) as-is since they populate the buffer and redraw in place.
Same root cause as #3144/#2893; #3178 fixed the spinner but not this path. Tested on kitty + Powerlevel10k, and suggest/commit/completion still behave.
@bogdanr Text is still getting clipped.
Updated the branch with the follow-up fix.
The previous change avoided reset-prompt at the end, but the old prompt/RPROMPT could still stay active while Forge was writing output. With long wrapped output, that could still make the last row look clipped.
This version clears and invalidates the active ZLE prompt before Forge writes output, then the final reset moves to a clean line without calling accept-line, so p10k/RPROMPT doesn’t repaint over the last output row.
Retested with the same reverse-text case and it looks good now.
Action required: PR inactive for 5 days. Status update or closure in 10 days.
PR closed after 10 days of inactivity.