tide: Prompt doesn't show immediately in new shell
Describe the bug
Upon launching the shell, the prompt will not appear until the enter key is pressed.
Steps to reproduce
Install fish and tide prompt.
Screenshots
Environment
Output of tide bug-report
:
fish version: 3.3.1
tide version: 4.3.4
term: xterm-256color
os: Ubuntu 20.04 on WSL2
terminal emulator: Windows Terminal
Additional context
Seems to have been fixed for others in the fish update to 3.3.1, but as you can see the issue persists for me after updating.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 7
- Comments: 28 (12 by maintainers)
Commits related to this issue
- Complete revert of faulty polling workaround 62d8f7277 ("Revert "Avoid excessive polling of universal variable file"") was not a complete revert, which seems to have caused the problem reported in ht... — committed to fish-shell/fish-shell by krobelus 3 years ago
- Complete revert of faulty polling workaround 62d8f7277 ("Revert "Avoid excessive polling of universal variable file"") was not a complete revert, which seems to have caused the problem reported in ht... — committed to thunder-coding/fish-shell by krobelus 3 years ago
- Use one prompt variable instead of two (closes #171) — committed to IlanCosman/tide by IlanCosman 3 years ago
Okay, then this is not the same bug, it’s an older bug that I don’t really care about. Thanks for reporting though 😄
I’ve made the changes suggested by @natecraddock that should fix the bug. I didn’t get around to reproducing it, or writing a test case yet.
I ran a git bisect on fish and I believe that b56b23007 introduced this bug.
I also reverted b56b23007 on the current fish master and that resolved the issue. I’m not aware of how Tide works, but I think this might still be something that needs to be solved in Tide because fish does work fine with the default prompt.
At this point I’m not sure where else to look. If there is anything else I can do to help let me know. Hopefully this information is helpful! 😃
b56b23007 was only partially reverted, and removing the remaining lines does solve the prompt failing to render when a terminal first opens
Describe and Reproduce
I have a similar bug on fish ver.3.3.1 and tide ver.5.0.0 (should be the latest for both of them).
When I start the terminal(alacritty), sometimes it shows only the cursor on the screen (the above image), and if I:
Some Extra Debug Info
In order to provide some information for debug, I added 4 lines (the commented lines in code) into
fish_prompt.fish
:Then I try to open and close terminal.
If tide start correctly(the prompt show up immediately), the contents in “tide-debug” file are:
If tide start in a bug way(only cursor), the contents are:
I suspect there’s something wrong with the
_tide_refresh_prompt
function, maybe a race condition or something?There are two ways to get rid of this issue (ABSOLUTELY NOT ACTUALLY FIX IT, just for debug purpose):
set -g _tide_self_repainting
sleep 1
below the linestring unescape $$_tide_left_prompt_display_var
. In this case, the prompt show up correctly(of course with dealy) when terminal launch, however, the second prompt always show the wrong path(one step behind), it seems the prompt doesn’t get repaint correctly, but it doesn’t affect the prompts after it, just as the following image:Environments
Terminal Emulator: Alacritty
Maybe it is low priority but it is a blocker for me and therefore I stopped using
tide
. Such a pity.Can someone with the bug verify that the
dev
branch fixes it?@leafinote You’re awesome! 😄 Yup, it seems to be a race condition between the the left and right prompt vars being updated. I can solve this by just combining those vars into a single prompt var. That’s probably a slight performance improvement as well.
Thanks a ton for helping me debug this 😄
I see this issue in fish 3.3.1 as well, though only about 70% of the time. Sometimes when I open a new terminal the prompt does show as expected, otherwise I must press enter before it is displayed.
I would like to try solving this issue myself, but am wondering why you don’t care. Is it too hard to solve? Just low-priority? Basically I want to avoid unnecessary work if you have already determined this issue too tricky to solve 😃