From 2c422e60f1724ac5639c80abb73dc1f10a91b5c6 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 2 Jul 2026 13:58:25 +0300 Subject: feat: inject powershell prompt shell integration for cwd reporting on windows refs #919 --- src/pane/osc.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/pane') diff --git a/src/pane/osc.rs b/src/pane/osc.rs index 2fef72a2..92a743c4 100644 --- a/src/pane/osc.rs +++ b/src/pane/osc.rs @@ -1057,6 +1057,21 @@ mod tests { ); } + // The quoted form is what Windows Terminal's documented shell integration + // snippet emits. Herdr's own injected prompt integration deliberately + // emits the path unquoted; see WINDOWS_POWERSHELL_SHELL_INTEGRATION_COMMAND. + #[test] + fn cwd_osc_tracker_detects_quoted_powershell_prompt_cwd_sequence() { + let mut tracker = CwdOscTracker::default(); + + tracker.observe(b"PS C:\\my proj> \x1b]9;9;\"C:\\my proj\"\x1b\\"); + + assert_eq!( + tracker.drain_latest(), + Some(std::path::PathBuf::from("C:\\my proj")) + ); + } + // ----------------------------------------------------------------------- // AgentOscStateTracker tests // ----------------------------------------------------------------------- -- cgit v1.2.3