tide icon indicating copy to clipboard operation
tide copied to clipboard

Last item on right prompt clipped

Open otommod opened this issue 2 years ago • 9 comments

Describe the bug

A 2-line right prompt gets clipped on the very edge of its first line.

Screenshots

exhibit1

exhibit2

Environment

fish version: 3.4.1
tide version: 5.3.0
term: foot
os: 
terminal emulator: 
fish startup: 34.10 millis
fisher plugins: IlanCosman/tide@v5

otommod avatar Jun 10 '22 18:06 otommod

This problem appears only in Alacritty, everything looks OK in other terminals I tried.

mibu-games avatar Aug 22 '22 17:08 mibu-games

I'm using foot though, not alacritty...

otommod avatar Aug 22 '22 17:08 otommod

This phenomenon also occurs in Windows Terminal. It might be caused by the same reason as #342.

wrvsrx avatar Sep 12 '22 12:09 wrvsrx

I met this problem both on wezterm on NixOS, wezterm on Windows (using WSL2) and windows terminal on Windows (using WSL2).

wrvsrx avatar Sep 16 '22 02:09 wrvsrx

https://github.com/IlanCosman/tide/blob/6833806ba2eaa1a2d72a5015f59c284f06c1d2db/functions/fish_prompt.fish#L54

I haven't figured out how to fix this, but I did notice that that if edit it so it doesn't print anything after a newline, the rightmost character stays intact. For example, replacing that line with any of these prints all the way to the right edge:

echo -ns \"\$$prompt_var[1][3]$top_right_frame$bot_left_frame\$$prompt_var[1][2]$color_normal \"
echo -ns \"\$$prompt_var[1][3]$top_right_frame\"\n
echo -ns \"\$$prompt_var[1][3]\"
echo \"\$$prompt_var[1][3]\"

My cursor ends up on the second line, but as soon as I type anything, the 2 rightmost characters of the first line get erased. (This is with a config generated by running tide configure and choosing options 1 1 1 2 1 1 1.)

Hopefully that'll help us get closer to a solution.

ajhall avatar Sep 16 '22 04:09 ajhall

Ok, I installed WezTerm and can now repro.

This is almost certainly a terminal/fish bug. It's not a coincidence that you are all using kinda new, weird, and niche terminals, while the vast majority of Tide users haven't experienced this bug 😄

The minimal example I can reproduce with is:

function fish_prompt
    string repeat --count=$COLUMNS -
    echo $PWD
end

If you can't reproduce the bug with this, please comment.

IlanCosman avatar Sep 16 '22 14:09 IlanCosman

Aha, it's been reported in Fish already.

https://github.com/fish-shell/fish-shell/issues/8002 They thought they had a workaround and closed this one, but the workaround caused more problems than it solved.

https://github.com/fish-shell/fish-shell/issues/8164 This is the one that's still open for this issue.

ajhall avatar Sep 17 '22 02:09 ajhall

BTW, tmux handles it, if someone is really interested to tackle this issue

ruslanSorokin avatar Sep 30 '23 03:09 ruslanSorokin