diff --git a/src/helpers/processes.rs b/src/helpers/processes.rs index 2a40144..c241d17 100644 --- a/src/helpers/processes.rs +++ b/src/helpers/processes.rs @@ -1,7 +1,10 @@ use crate::config::Config; use anyhow::{anyhow, Result}; -use std::sync::{atomic::AtomicBool, Arc}; -use tokio::process::Command; +use std::{ + sync::{atomic::AtomicBool, Arc}, + time::Duration, +}; +use tokio::{process::Command, time::sleep}; use super::{ directories, get_platform_name, @@ -133,6 +136,8 @@ pub async fn handle_nvim_process(config: &Config, args: &[String]) -> Result<()> _term.store(false, Ordering::Relaxed); } } + // short delay to a void high cpu usage + sleep(Duration::from_millis(200)).await; } Err(_) => return Err(anyhow!("Failed to wait on child process")), }