-
-
Notifications
You must be signed in to change notification settings - Fork 973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
git info eventually stops being updated #455
Comments
Thanks for the report, I'll try to look into this later today. It's curious though, I have much the same setup, sans antibody. Can you list any other zsh plugins you might be using? Also, what method of authentication do you use for Git? HTTPS? SSH? If SSH, do you use GPG, etc? Are you ever prompted for passwords in the terminal (or outside)? If this happens to you again, the output from And finally, if you don't mind, could you test out this PR #454? The reason I suggest it is that if your issue is related to the zpty worker crashing, then the PR could help by allowing the worker to be restarted the next time you hit enter in the prompt. |
sure thing: https://github.com/caarlos0/dotfiles/blob/master/antibody/bundles.txt
SSH. I use GPG to sign commits, yes. No, never get prompted for passwords...
Sure thing! Will just wait for it to happen again to get the pstree output :) |
Happened again:
|
Interesting, it indeed looks like the async worker ( I just realized, since you're using antibody, you might already have been running part of the #454 PR (e.g. the One thing that stands out from your I'll have to get back to you on this after the holidays, have a great one! |
yeah, no worries! Wish you great holidays! Thanks for the great work! |
I have the same issue here. May I ask any update on this? |
@sandangel still requires more info, I haven't been able to reproduce the issue, at least not reliably. It has stopped working for me on a few rare occasions as well but usually in combination with something else failing too (e.g. zsh-fast-syntax-highlighting which also is async). It's tricky, so any information you can provide will be helpful. |
Yeah, it rarely happens to me too and I had to kill the terminal. I don't know how to reproduce reliably too. Currently, I decided to move to alien-minimal, another prompt that uses zsh-async but was not happy with it like pure so I just come here to see if the issue was fixed. |
Curious, did you use |
Also, another question: Are either of you working on a lot of things when it happens, with many terminals/tabs or processes open on the computer? One reason could be that resource limits are being hit preventing more processes from being spawned. |
I have just started using alien-minimal today.
Yes, I have about 5 tmux pane with 3 to 4 windows each pane. I'm working on about 3 or 4 repos at the same time. |
yes, always have like 3+ iTerm tabs with several panels in each one.. |
I also run in the same issue regularly, I have to source my zsh config each time it happens.
I usually have about 8 tmux windows. |
not sure if helps on anything, but we have those plugins in common... |
Hmm, I use / or have used all three myself (albeit my own fork of Could you try changing this line: https://github.com/mafredri/zsh-async/blob/98d32afcce8e328be86f381c529e951943e57d19/async.zsh#L71 to:
? Let me know if any errors appear in the log when the problem occurs. |
sure, done it... will observe and report whatever I find :) |
Just to add my two cents, I've been experiencing this for several months. I commented on a previous issue (#435 (comment)), but my experience was actually unrelated to that issue. @mafredri asked me to open a new issue to troubleshoot, but I got busy/forgot! I do apologize. But this time I'm sure my issue is the same as described here, ha. I'm going to try changing the line above and see if I get any positive results. I won't forget to report back this time! And if it's helpful, here's my setup for reference and a screenshot of the error happening (first the down arrow signifying upstream updates did not go away after a
|
Just had the issue here again, |
Dang :/, thanks for testing though. I'll try to get back to this after my vacation (gone for a week). In the meanwhile, @ttamnedlog how easily can you reproduce the issue? I think this is going to be a hard one to debug without being able to reproduce it myself. Any chance this would be reproducible e.g. in a Docker container? In the meantime, some more logging might help narrow this down: Line 391 in d5e14a3 print "$0: $@" >> /tmp/pure.log https://github.com/mafredri/zsh-async/blob/98d32afcce8e328be86f381c529e951943e57d19/async.zsh#L308 print "$0: $@" >> /tmp/async.log |
I thought I would report this, even if it has only been a day that I have switched to
|
Not easily. Sadly, it's the same as described by @caarlos0. It happens seemingly randomly after hours of work. Some days it happens a few times a day, other days it doesn't happen at all. I'm sure my work habits vary from day to day but I can't pinpoint what I might have done on the days it occurs. A rough description of my work habits, in case you see anything helpful: I don't use tmux on my machine (I do use it occasionally while in a remote terminal, but the remote doesn't have Pure anyway so none of that applies). I usually have two or three iTerm tabs open in different directories within a repo. And I often hop around to different repos. One tab is probably a task runner watching for file modifications and compiling assets. One tab is probably just the shell for system commands and certain git commands like switching branches and pushing and pulling. And one tab is usually in Vim. It's probably 50/50 whether or not I stage and commit from my iTerm tab at the shell or if I do it from within Vim using fugitive. In the past, working this way, it wasn't abnormal for me to switch iTerm tabs and see that one Pure git status indicator was showing the wrong branch or status. That's not the issue being discussed here, just to clarify. I didn't consider that a bug; I wouldn't expect one iTerm tab to know what the other is doing anymore than I'm surprised when I trash a directory in Finder and then in iTerm try to The bug we're discussing here doesn't necessarily occur due to multiple tab tomfoolery. In the screenshot I posted, for example, that's not my repo, so I wasn't working in that directory or having multiple tabs of that directory open. I just hopped into the zsh-syntax-highlighting plugin directory, Pure async told me there were upstream changes, I run Sorry this was so long! I hope it was helpful. I know this is difficult to nail down without some clearer steps to reproduce. Thanks for looking into it. I'll enable the additional logging you suggest and keep you posted! |
also had issue with zsh-syntax-highlighting and this problem. |
I replaced zsh-syntax-highlighting with fast-syntax-highlight, still got the issue, but it's less frequent I think |
I'm also running into this issue. Are there any steps I can follow to help you debug this? |
@OliverJAsh any information you can provide could be helpful. E.g what's been discussed here and reports of how often it happens, what you were doing at the time and if it's limited to some specific repo. Also versions of the software / operating system you are using (as above). I haven't gotten around to try to debug this much further, it's tricky without a solid way to reproduce it. I wonder, is it only limited to macOS? |
PS. Zsh 5.7.1 is out, does it also happen on it? |
Maybe every 1/2 hours or so.
iTerm 3.2.6 I will try with the latest version of Zsh (5.7.1). I've also just tried pure-prompt to 1.9.0 so I will see if that helps. |
alacritty 0.2.9 What happensWhen it happens, these effects are observed:
How often it happensIt happens very sporadically. Thank you for the great workThis prompt is very nice and feels very snappy. Keep up the awesome work! |
@wooken thanks for the report!
This I believe could be related to autosuggestions. I've experienced it myself when using it. Here's my answer to cleaning up some of the zsh-asug behavior: modules/zsh-autosuggestions.zsh
If possible, I'd suggest that everyone here who uses zsh-autosuggestions and is experiencing the issue would try using the above method of loading it, see if it helps. |
Does anyone know of a workaround without exiting zsh? |
Took a look at this again after a talk with @sindresorhus about it, he pointed out some commits that got me thinking... so, I've created two branches:
Please, if you can reproduce, give them a try and report back! |
I switched to use this branch after your comment and I don't get a branch at all. I'll try |
Oh, looks like I made a booboo, fixed |
I can confirm that |
The git dirty status |
Thanks for testing Sindre, it really is the worst news I could've hoped for 😂😭. If not even |
@mattpolito has cancelled funding for this issue.(Cancelled amount: $40.00) See it on IssueHunt |
I just ran into this on again (
Can anybody else confirm this? It doesn't really provide clues to the underlying issue, but could help us work around it in the meantime. |
@mafredri I can confirm that running the above command brought it back to life. |
@sindresorhus thanks for confirming. I've found what I believe to be the ~reason for this. Well, I can't explain why it happens, but at least where. There's now a new PR open in zsh-async (mafredri/zsh-async#37) which addresses it and a few more improvements fueled by paranoia. I believe this is where we ran into trouble until now: mafredri/zsh-async#37/files#diff-c7f89cff42efffc19f69071441a12a1cR170-R174. I've now created the indestructible-pure branch, which listens to the new signals from zsh-async and should allow for recovery on next prompt. I managed to trigger the issue a few times before making all of the above changes, but after I added the handling in Pure, I could no longer 😅. Anyway, please try it out. Ideally, as a next step, I'd like to automatically detect worker crashes in zsh-async and do the restart there, but we'll see. |
I just reproduced the issue on my local system and running the command |
I think it is the problem with In my case the above stated workaround do not work. Tested in |
The nimble/pure theme are unusable with git aync bug. sindresorhus/pure#455
@mafredri been trying indestructible-pure branch the last few days and I have yet to run into git info issues or 100% CPU usage |
In case anyone runs into this problem: In switching to the
Turns out |
@sindresorhus do you plan to release a new version with this fix? |
would be awesome! |
Had some time last weekend to work on this and wrapped it up today, the final iteration of zsh-async and pure worker restarting is now in #543. Please, for anyone affected, give it a spin and report any issues here. Workers can still crash, but restarts are completely transparent and should not result in any inconveniences for the user. |
Oh, might as well add this as well. So last weekend I automated triggering this bug, but it's by no means reliable and requires bruteforceing. Anyway, this is what I came up with (run in a terminal that is not iTerm): Variant that hops between home and my local Pure repo, does not require iTerm to be in focus but produces a lot of noise. while :; do
for dir in ~ ~/Projects/Pure; do
osascript -e '
tell application "iTerm"
tell current session of current window
write text "cd '$dir'"
end tell
end tell
'
sleep 0.22
done
done Variant using osascript -e 'activate application "iTerm"'
for i in {1..1000}; do
for i in {1..31}; do
osascript -e '
tell application "System Events"
key code 124 using {shift down, control down}
end tell
'
sleep 0.12
done
sleep 2.01
done Sleeps are just randomly picked from whatever seems to trigger it occasionally. |
@sindresorhus has rewarded $72.00 to @mafredri. See it on IssueHunt
|
General information
I have:
Problem description
When I'm using a terminal panel for some time (hours or days), changing branches and etc, eventually, git info stops updating... it shows the old branch, for example,
branch1
, even though I keep changing branches. The arrows indicating push/pull also are not shown.If I open another terminal panel/tab on the same folder, everything works as expected.
Reproduction steps
Don't know... :/
My
.zshrc
:Not sure what's needed because I'm not sure what's causing it, but, pure-related, here it is:
IssueHunt Summary
Backers (Total: $80.00)
Submitted pull Requests
Tips
The text was updated successfully, but these errors were encountered: