diff --git a/crates/nu-cli/src/repl.rs b/crates/nu-cli/src/repl.rs index 29c2f62734..d9aef32bbb 100644 --- a/crates/nu-cli/src/repl.rs +++ b/crates/nu-cli/src/repl.rs @@ -1110,9 +1110,9 @@ fn run_shell_integration_osc9_9(engine_state: &EngineState, stack: &mut Stack, u let start_time = Instant::now(); // Otherwise, communicate the path as OSC 9;9 from ConEmu (often used for spawning new tabs in the same dir) + // This is helpful in Windows Terminal with Duplicate Tab run_ansi_sequence(&format!( - "\x1b]9;9;{}{}\x1b\\", - if path.starts_with('/') { "" } else { "/" }, + "\x1b]9;9;{}\x1b\\", percent_encoding::utf8_percent_encode(&path, percent_encoding::CONTROLS) ));