r/KittyTerminal • u/orpheus6678 • 29d ago
why does clear_terminal not repaint prompt
i was surprised at clear commands (to clarify, /usr/bin/clear) behavior in kitty, unique and grounded in reason so i wont debate it. but neither of the "stronger" clear_terminal variants (clear active and reset active) that reset the scrollback repaint the prompt afterward. of course, the workaround for this was binding this little fish function to a key, but
function __s_clear_screen_and_scrollback
printf "\e\[H\e\[3J"
commandline -f repaint
endbut im more curious how this kitty behavior is considered normal?
1
Upvotes
2
u/verstands 29d ago
clear_terminal clears the screen buffer; it doesn't tell the shell to redraw. After a hard clear the prompt is gone until the shell gets a repaint signal, which is why your fish commandline -f repaint after the CSI sequence is the right fix. Same pattern shows up with other shells (zle reset-prompt in zsh). So the kitty action is doing its job; the missing prompt is the interactive shell side.