Open mtardy opened 1 year ago
Yah it'd be nice, I'll try.
Thanks a lot! Yes considering the title change (that was reverted so I think you already understand), just to be super clear, it is not only when a new session is created, but also when clearing the terminal with clear
or CTRL+L
(\033c
).
I tried to look at how p10k did it but the syntax was too hardcore for a shell newbie like me.
i'd love to see that as well! it took me a bit until i realized that the empty first line in the prompt was caused by the "sparse" setting. any idea what exactly would need to be changed in #419 to make this work?
EDIT: Managed to hack it together by chosing the "compact" prompt and adding these lines to my ~/.config/fish/config.fish
. The example is given in the stackoverflow answer, and this also works with Ctrl + L
.
status --is-interactive; and begin
# this fixes the "sparse" layout of the tide prompt
function postexec_newline --on-event fish_postexec
echo
end
end
EDIT 2: This is a slightly improved version, I think, because the previous version would sometimes print the empty line too early for me. To be clear, I configured tide
to use the compact
layout and added this bit of code and all is working well so far:
status --is-interactive; and begin
# this fixes the "sparse" layout of the tide prompt
set first_line true
function sparse_prompt --on-event fish_prompt
if test "$first_line" = true
set first_line false
return
end
# print newline for sparse layout
echo
end
end
First of all thanks for creating tide, I just tried fish and it's amazing to have a p10k equivalent for fish. This bug is just a minor annoyance but I don't know how to resolve it by myself :(!
Describe the bug
I stole the description here because this is the exact same problem.
However, the newline is also printed when there is no previous output, e.g. after clearing the terminal with printf "\033c" (or when the terminal is first opened):
Steps to reproduce
Use
tide configure
and use prompt spacing(2) Sparse
to see the issue.Screenshots
This is what happens with tide and fish:
This is what happens with powerlevel10k and zsh:
Even the configuration wizard of tide advertises the behavior intended and not the reality:
Environment
Additional context
I guess what we see is happening here for double line prompt and here for simple line prompt but I don't know how we can detect reliably we just started the interactive shell session or not.