MrPicklePinosaur / shrs

The rusty shell toolkit for hackers
https://mrpicklepinosaur.github.io/shrs/
Apache License 2.0
310 stars 27 forks source link

[Bug]: Running nvim in shrs uses a lot of cpu #349

Closed nithinmuthukumar closed 7 months ago

nithinmuthukumar commented 9 months ago

What went wrong?

Screenshot 2024-01-08 at 8 27 44 PM

Not sure what the reason is, will need further investigation

Once nvim is closed, it goes back to using very little resources

MrPicklePinosaur commented 9 months ago

interesting, i also randomly get really high cpu spikes for no reason. maybe the shell is busy looping for output or something when running an interactive command?

rithikasilva commented 9 months ago

Just to add, running htop and even cmatrix (needed to find something not super complicated that hijacks your terminal output lol) does this. Seems like it's output related, but not 100% sure.

nithinmuthukumar commented 7 months ago

I believe the issue is with self.wait_for_job(job_id); in job.rs. Removing the line and replacing with sleep(Duration::from_secs(30)); Seems to remove all performance issues. I thought it had to do with the duration of the program as it waits, but other long processes dont have any effects on performance, unless they take control of the terminal.