Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add OSC 9;9 support for PowerShell prompt to enable Windows Terminal directory tracking#3026

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge3 commits intomaster
base:master
Choose a base branch
Loading
fromcopilot/fix-3025

Conversation

Copy link

CopilotAI commentedSep 16, 2025
edited
Loading

Implements OSC 9;9 escape sequence emission in Cmder's PowerShell prompt to enable Windows Terminal's "Duplicate Tab" and "Split Pane" features to preserve the current working directory. This matches the recent fix for cmd.exe/Clink and follows Microsoft's published guidance for Windows Terminal integration.

Changes Made

Modifiedvendor/profile.ps1:

  • Added OSC 9;9 sequence emission in the main$Prompt scriptblock
  • Only emits when running in Windows Terminal ($env:WT_SESSION) or ConEmu ($env:ConEmuPID)
  • Only emits for FileSystem provider paths (skips Registry, etc.)
  • Added comprehensive comments explaining the functionality

UpdatedREADME.md:

  • Added documentation about Windows Terminal directory tracking support
  • Noted that both cmd.exe and PowerShell sessions now support this functionality

Implementation Details

The OSC 9;9 sequence (ESC]9;9;"<path>"ESC\) is emitted before each prompt display when:

  1. Running in a supported terminal environment (Windows Terminal or ConEmu)
  2. Current location uses the FileSystem provider
  3. All conditions are met for directory tracking

This implementation is:

  • Non-invasive: No changes to prompt appearance or existing functionality
  • Compatible: Works with existing posh-git and user customizations
  • Gated: Only active in supported terminal environments
  • Safe: Only emits for appropriate path types

Example Usage

When using Cmder with PowerShell in Windows Terminal:

  1. Navigate to any directory:cd C:\Projects\MyApp
  2. Use Ctrl+Shift+D to duplicate tab → new tab opens inC:\Projects\MyApp
  3. Use split pane operations → new panes open in the same directory

This provides the same seamless directory tracking experience that cmd.exe/Clink users have enjoyed.

Fixes#3025.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Clickhere to start the survey.

This comment was marked as off-topic.

CopilotAIand others added2 commitsSeptember 16, 2025 10:52
…directory trackingCo-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
…ntationCo-authored-by: DRSDavidSoft <4673812+DRSDavidSoft@users.noreply.github.com>
CopilotAI changed the title[WIP] [Feature request] Add OSC 9;9 support for PowerShell prompt in Cmder to enable Windows Terminal duplicate/split in same directoryAdd OSC 9;9 support for PowerShell prompt to enable Windows Terminal directory trackingSep 16, 2025
Copilot finished work on behalf ofDRSDavidSoftSeptember 16, 2025 10:55
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@DRSDavidSoftDRSDavidSoftAwaiting requested review from DRSDavidSoft

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Feature request] Add OSC 9;9 support for PowerShell prompt in Cmder to enable Windows Terminal duplicate/split in same directory

2 participants

@DRSDavidSoft

[8]ページ先頭

©2009-2025 Movatter.jp