tide
tide copied to clipboard
Last item on right prompt clipped
Describe the bug
A 2-line right prompt gets clipped on the very edge of its first line.
Screenshots
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
This problem appears only in Alacritty, everything looks OK in other terminals I tried.
I'm using foot
though, not alacritty
...
This phenomenon also occurs in Windows Terminal. It might be caused by the same reason as #342.
I met this problem both on wezterm on NixOS, wezterm on Windows (using WSL2) and windows terminal on Windows (using WSL2).
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.
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.
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.
BTW, tmux handles it, if someone is really interested to tackle this issue