From 61d3b1635e04b0018f2920eb4d41437fa2c0a795 Mon Sep 17 00:00:00 2001 From: Arijit Basu Date: Thu, 2 Jun 2022 10:36:48 +0530 Subject: [PATCH] Use NO_COLOR to disable OSC 7 --- src/runner.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/runner.rs b/src/runner.rs index e7f66f1..57c78b2 100644 --- a/src/runner.rs +++ b/src/runner.rs @@ -371,13 +371,15 @@ impl Runner { last_focus = focus.cloned(); // OSC 7: Change CWD - terminal.backend_mut().write( - format!( - "\x1b]7;file://{}{}\x1b\\", - &app.hostname, &app.pwd - ) - .as_bytes(), - )?; + if !(*ui::NO_COLOR) { + terminal.backend_mut().write( + format!( + "\x1b]7;file://{}{}\x1b\\", + &app.hostname, &app.pwd + ) + .as_bytes(), + )?; + } } // UI