IlanCosman / tide

🌊 The ultimate Fish prompt.
MIT License
2.91k stars 108 forks source link

Last item on right prompt clipped #310

Open otommod opened 2 years ago

otommod commented 2 years ago

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
mibu-games commented 2 years ago

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

otommod commented 2 years ago

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

wrvsrx commented 2 years ago

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

wrvsrx commented 2 years ago

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

ajhall commented 2 years ago

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.

IlanCosman commented 2 years ago

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.

ajhall commented 2 years ago

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.

ruslanSorokin commented 1 year ago

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

pachungulo commented 1 month ago

A simple workaround to save time for people who can't stand this issue, add this to your conf.d (or config.fish) set -g tide_right_prompt_suffix " "