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

complete --wraps can cause a background thread to burn CPU #5638

floam opened this Issue Feb 10, 2019 · 2 comments


None yet
3 participants
Copy link

commented Feb 10, 2019

I happened upon a fish process using "300%" CPU that was still interactive, when working on the alias script, which sets --wraps on functions it creates, and this is a reduced test-case:

~ $ complete -c a --wraps "a (b)"
~ $ complete -c a --wraps "a (b) "
~ $ a<TAB>

A thread is going nuts trying to walk the wrap chain.


@floam floam added this to the fish-future milestone Feb 10, 2019

@ridiculousfish ridiculousfish self-assigned this Feb 12, 2019


This comment has been minimized.

Copy link

commented Feb 12, 2019

Sounds like #5541


This comment has been minimized.

Copy link

commented Feb 12, 2019

He... "sudo -s -s -E"".

As reported by @SamHH in #5646, alias sudo="sudo -s" also exhibits something like this.

And the underlying cause should be fairly similar - sudo is a wrapper for sudo -s, only those completions call complete -C. This gets around our depth restrictions - because this is an entirely different complete call, the counter starts again at 0.

Similarly, in @floam's example you need both wrap calls. So I'd imagine one wraps the other, so it ping-pongs from one to the other and back again.

zgracem added a commit to zgracem/dotconfig that referenced this issue Apr 25, 2019

remove self-referencing `--wraps`
This might address the issue where fish goes nuts with background CPU:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.