-
Notifications
You must be signed in to change notification settings - Fork 2.1k
High cpu usage on directory change in mc with fish subshell #6763
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
Comments
Thanks for filing, I'll try to reproduce! |
What command do you run? I tried:
and this resulted in "Cannot get terminal settings: Inappropriate ioctl for device (25)" but no high CPU usage. |
I run it like
and then move cursor on any folder and press enter 10-20 times |
I can reproduce on 3.1.0. Seems to be fixed on current master, probably by e334bec. With latest master I get around 50% CPU utilization when pressing Enter repeatedly, and around half of the time seems to be spent on UTF8 -> internal UTF32 conversion if I measured correctly. These are directories with 100-200 files. Anyway that doesn't seem harmful. |
I found .local/share/fish/fish_history file which is 3.8Mb, ~100k lines No more high cpu usage after I renamed it |
@olfway great point! This was caused by autosuggestions. Apparently, Autosuggestions are generally very useful but we can definitely disable history autosuggestion if the command line starts with a space, so this should be fixed now by 390647a. |
Currently we do not add such command lines to the history, so there won't be a suggestion from history anyway. Fixes #6763 which occurs because midnight commander feeds fish commands like this one (note the leading space) ` cd (printf '%b' '\0057home\0057johannes\0057git\0057fish\0055shell\0057build')` (cherry picked from commit 390647a)
Shouldn't the search ignore the leading space? |
I see, it could be convenient to type a leading space and still have history autosuggestions available. Currently you'd have to type the command first with autosuggestions and then prepend the space. Maybe there's another workaround for mc? I think we could do some minimal caching for failing autosuggestions: after a history search for autosuggestions fails, as long as subsequent edits to the command line only append to it, don't run history autosuggestion again. It'd give not that much improvement, since e334bec already kind of does that, but probably still reduces the load. |
I'm using fish and midnight commander from homebrew on mac
fish, version 3.1.0
TERM = xterm-256color
I removed ~/.config/fish to test with empty config
If I run mc with fish subshell and press enter multiple times on some directory fish subshell start using ~130% cpu for some time
I tried to build fish with debug symbols and get backtrace while it was using cpu:
The text was updated successfully, but these errors were encountered: