Fix deletion of prompt in last 2 columns when first line soft wrapped

When drawing a soft wrapped line, the last 2 characters of the previous line are redrawn. If these 2 characters are occupied by the prompt, they are replaced with ' '.
Steps to reproduce:
fish -C 'function fish_prompt; printf %0"$(math $COLUMNS)"d 0; end'
# type anything
# observe that the last two characters of the prompt have been deleted
This commit is contained in:
kerty
2025-01-28 17:43:06 +03:00
committed by Johannes Altmanninger
parent 9915a07741
commit e2c9969840
2 changed files with 45 additions and 27 deletions

View File

@@ -29,10 +29,20 @@ isolated-tmux send-keys Enter
isolated-tmux send-keys echo Space 123
tmux-sleep
isolated-tmux send-keys C-g
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: prompt 0> <status=0> <> echo 123
# CHECK: current token is <123>
# CHECK: prompt 0> <status=0> <> echo 123
tmux-sleep
isolated-tmux send-keys C-u '
function fish_prompt
printf "full line prompt\nhidden<----------------------------------------------two-last-characters-rendered->!!"
end' Enter C-l
isolated-tmux send-keys 'test "' Enter 'indent"'
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: full line prompt
# CHECK: …<----------------------------------------------two-last-characters-rendered->!!
# CHECK: test "
# CHECK: indent"