From 218400a4b8d8e1aa34a19e9d04114f8c7481afd9 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:47:03 +0000 Subject: [PATCH 1/3] Initial plan From 08ce81609afce4a6ff2e8aa22f172067f85adcd0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:52:13 +0000 Subject: [PATCH 2/3] Add OSC 9;9 support for PowerShell prompt to enable Windows Terminal directory tracking Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com> --- vendor/profile.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/vendor/profile.ps1 b/vendor/profile.ps1 index 1183377..0a37534 100644 --- a/vendor/profile.ps1 +++ b/vendor/profile.ps1 @@ -196,6 +196,15 @@ if ( $(Get-Command prompt).Definition -match 'PS \$\(\$executionContext.SessionS [ScriptBlock]$Prompt = { $lastSUCCESS = $? $realLastExitCode = $LastExitCode + + # Emit OSC 9;9 sequence for Windows Terminal directory tracking + # This enables "Duplicate Tab" and "Split Pane" to preserve the working directory + # Only active in Windows Terminal ($env:WT_SESSION) or ConEmu ($env:ConEmuPID) + $loc = $executionContext.SessionState.Path.CurrentLocation + if (($env:WT_SESSION -or $env:ConEmuPID) -and $loc.Provider.Name -eq "FileSystem") { + Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]27)]9;9;`"$($loc.ProviderPath)`"$([char]27)\" + } + $host.UI.RawUI.WindowTitle = Microsoft.PowerShell.Management\Split-Path $pwd.ProviderPath -Leaf Microsoft.PowerShell.Utility\Write-Host -NoNewline "$([char]0x200B)`r$([char]0x1B)[K" if ($lastSUCCESS -or ($LastExitCode -ne 0)) { From 545331a336ba5ca9488db7d979acbbb3bf1f8f06 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 16 Sep 2025 10:53:33 +0000 Subject: [PATCH 3/3] Update README with Windows Terminal directory tracking feature documentation Co-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com> --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 735fd1e..72dec0e 100644 --- a/README.md +++ b/README.md @@ -352,6 +352,8 @@ Cmder by default comes with a vendored ConEmu installation as the underlying ter However, Cmder can in fact run in a variety of other terminal emulators, and even integrated IDEs. Assuming you have the latest version of Cmder, follow the following instructions to get Cmder working with your own terminal emulator. +⚠ *Note:* Cmder includes built-in support for Windows Terminal directory tracking via OSC 9;9 sequences. This enables "Duplicate Tab" and "Split Pane" features to preserve the current working directory for both `cmd.exe` and PowerShell sessions. + For instructions on how to integrate Cmder with your IDE, please read our [Wiki section](https://github.com/cmderdev/cmder/wiki#cmder-integration). ## Upgrading