yazi-rs / plugins

Place code snippets from docs into this monorepo, so that users can update more easily via package manager.
71 stars 7 forks source link

git plugin spawns many git processes #20

Closed sibouras closed 1 week ago

sibouras commented 1 week ago

What system are you running Yazi on?

Windows

What terminal are you running Yazi in?

windows-terminal 1.21.2361.0

yazi --debug output

```sh Yazi Version: 0.3.3 (7c445ce 2024-09-04) Debug : false OS : windows-x86_64 (windows) Ya Version: 0.3.3 (7c445ce 2024-09-04) Emulator Emulator.via_env: ("", "") Emulator.via_csi: Ok(Unknown([])) Emulator.detect : Microsoft Adapter Adapter.matches: Sixel Desktop XDG_SESSION_TYPE : None WAYLAND_DISPLAY : None DISPLAY : None SWAYSOCK : None HYPRLAND_INSTANCE_SIGNATURE: None WAYFIRE_SOCKET : None SSH shared.in_ssh_connection: false WSL WSL: false Variables SHELL : None EDITOR : Some("nvim") VISUAL : None YAZI_FILE_ONE : None YAZI_CONFIG_HOME : None Text Opener default: Some(Opener { run: "hx %*", block: true, orphan: false, desc: "hx", for_: None, spread: true }) block : Some(Opener { run: "hx %*", block: true, orphan: false, desc: "hx", for_: None, spread: true }) Multiplexers TMUX : false tmux version : program not found ZELLIJ_SESSION_NAME: None Zellij version : program not found Dependencies file : 5.45 ueberzugpp : program not found ffmpegthumbnailer: program not found magick : program not found fzf : 0.55.0 fd : 10.2.0 rg : 14.1.0 chafa : program not found zoxide : 0.9.4 7z : 23.01 7zz : program not found jq : 1.7.1 ```

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

the git plugin is spawning git processes infinitely on windows and causing high cpu usage, here's a video:

https://github.com/user-attachments/assets/ecd18096-dacb-4861-88f9-514ca09ae5b6

also git operations are slow on windows so frequent git calls are noticeable, here's a wsl and windows comparison:

yazi-git-benchmark

Expected Behavior

not to spawn infinite git processes

To Reproduce

open yazi on windows and monitor git process with btop and lower the update timer to 100ms

Configuration

No response

Anything else?

No response

sxyazi commented 1 week ago

I can't reproduce it on my windows vm. Do you have any other plugins enabled? Does this happen with other directories?

sibouras commented 1 week ago

so i tried disabling all plugins and yes it happens in other directories, but the culprit turned out to be show_hidden = true when i set it to false its fixed! and showing the hidden files with . spawns the git processes again

sxyazi commented 1 week ago

Please try https://github.com/yazi-rs/plugins/commit/0573024ca23a871df92383841d5eca32e4fc62f0

sibouras commented 1 week ago

its fixed thanks