fix: prevent prompt corruption in fish v4

fish v4 introduced new multiline prompt rendering behavior that breaks
when interactive commands like `navi` are injected via keybindings. this
resulted in partial prefix symbols (e.g. from a prompt's newline
component) being left on screen and improperly rendering the expanded
command (e.g. `gzgzip` instead of `gzip`).

this forces a full redraw so it's cosmetically identical to running
`navi` (as a command without insertion)
This commit is contained in:
Lam Chau 2025-06-06 02:09:06 -07:00
parent e657f4b6b5
commit 023e52d1fb

View file

@ -5,6 +5,7 @@ function _navi_smart_replace
set --local best_match (navi --print --query "$query" --best-match)
if test -n "$best_match"
commandline --current-process $best_match
commandline -f repaint
return
end
end
@ -12,6 +13,7 @@ function _navi_smart_replace
set --local candidate (navi --print --query "$query")
if test -n "$candidate"
commandline --current-process $candidate
commandline -f repaint
end
end