From 744b68197dbd23c547367c94d3ab6e497359ccbe Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Thu, 2 Jun 2022 11:03:23 +0530 Subject: [PATCH] Some optimizations --- src/runner.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/runner.rs b/src/runner.rs index 57c78b2..c3c3a36 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -236,6 +236,7 @@ impl Runner { }; let mut last_focus: Option = None; + let mut last_pwd = app.pwd.clone(); let mut mouse_enabled = app.config.general.enable_mouse; if mouse_enabled { @@ -356,8 +357,6 @@ impl Runner { } Refresh => { - // $PWD watcher - tx_pwd_watcher.send(app.pwd.clone())?; // Fifo let focus = app.focused_node(); if focus != last_focus.as_ref() { @@ -369,6 +368,11 @@ impl Runner { )?; }; last_focus = focus.cloned(); + } + + if app.pwd != last_pwd { + // $PWD watcher + tx_pwd_watcher.send(app.pwd.clone())?; // OSC 7: Change CWD if !(*ui::NO_COLOR) { @@ -380,6 +384,8 @@ impl Runner { .as_bytes(), )?; } + + last_pwd = app.pwd.clone(); } // UI