Skip to content
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

High cpu usage after update today #353

Closed
Pilgrim1379 opened this issue Oct 5, 2021 · 10 comments
Closed

High cpu usage after update today #353

Pilgrim1379 opened this issue Oct 5, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@Pilgrim1379
Copy link
Sponsor

I'm on macos Big Sur 11.6 and I updated my zsh addons with zsh pull. Since that, as soon as I start iTerm my macbook fan goes berserk and start spinning full on.

When I disable only zsh-autocomplete the problem goes away.

Any ideas?

@Pilgrim1379 Pilgrim1379 added the bug Something isn't working label Oct 5, 2021
@Omoeba
Copy link

Omoeba commented Oct 6, 2021

I'm seeing the same issue using oh-my-zsh to manage plugins.

@Omoeba
Copy link

Omoeba commented Oct 6, 2021

Reverting commit 7b1a81c fixes the issue.

@TonAtLacework
Copy link

For every command you seem to spin up a new zsh session. Please fix because this makes the plugin unusable.
Screen Shot 2021-10-06 at 14 20 28

@marlonrichert
Copy link
Owner

Oh, wow! I can see it, too, on my Mac. It's quite insane.

Weird that I didn't see this on Linux. I wonder what's different?

@Omoeba Thanks for identifying the commit. I won't revert it entirely, though. That would be throwing out the baby with the bathwater. Sorry, but I will have to close your PR, unless you can update it rollback only the exact changes that cause the problem.

@ThePreacher No clear idea yet, but I will investigate.

Please fix

As if I would do anything else. 🤪

@Omoeba
Copy link

Omoeba commented Oct 6, 2021

I'm not too familiar with zsh so unfortunately I won't be able to identify the exact problematic changes.

@marlonrichert
Copy link
Owner

Amazing how just one missing character can wreak so much havoc.

diff --git a/scripts/.autocomplete.async b/scripts/.autocomplete.async
index beae03e..961d3b0 100644
--- a/scripts/.autocomplete.async
+++ b/scripts/.autocomplete.async
@@ -280,7 +280,7 @@ log_functions+=( .autocomplete.async.pty )
     builtin zle .autocomplete.async.pty.completion-widget -w 2> /dev/null
   } always {
     print -rNC1 -- \
-        "$_autocomplete__list_lines" "$_autocomplete__mesg" "$_autocomplete__comp_mesg[@]" '\C-C'
+        "$_autocomplete__list_lines" "$_autocomplete__mesg" "$_autocomplete__comp_mesg[@]" $'\C-C'
     builtin kill $sysparams[pid]
   }
 } 2>>| $_autocomplete__log_pty

@marlonrichert
Copy link
Owner

@Omoeba Don't worry about it. Identifying the broken commit was already very helpful. 👍🏽

@marlonrichert
Copy link
Owner

marlonrichert commented Oct 6, 2021

For every command you seem to spin up a new zsh session.

@TonAtLacework They're technically not sessions. They're forked child processes. Without them, we wouldn't be able to do multiple things asynchronously.

@Omoeba
Copy link

Omoeba commented Oct 6, 2021

Amazing how just one missing character can wreak so much havoc.

diff --git a/scripts/.autocomplete.async b/scripts/.autocomplete.async
index beae03e..961d3b0 100644
--- a/scripts/.autocomplete.async
+++ b/scripts/.autocomplete.async
@@ -280,7 +280,7 @@ log_functions+=( .autocomplete.async.pty )
     builtin zle .autocomplete.async.pty.completion-widget -w 2> /dev/null
   } always {
     print -rNC1 -- \
-        "$_autocomplete__list_lines" "$_autocomplete__mesg" "$_autocomplete__comp_mesg[@]" '\C-C'
+        "$_autocomplete__list_lines" "$_autocomplete__mesg" "$_autocomplete__comp_mesg[@]" $'\C-C'
     builtin kill $sysparams[pid]
   }
 } 2>>| $_autocomplete__log_pty

haha it's always the tiniest things that get ya

@marlonrichert
Copy link
Owner

PS: If you enjoy using my software, please consider sponsoring me. 🙂

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants