github / github/app

Windows paths pasted into the chat composer silently lose backslashes

オープン
#2,784 コメント 0 件 リアクション 0 件 担当者 1 名 @dentifrag が担当を希望しています GitHub で見る
triage
主要言語
言語のデータがありません
スター
2.1k
フォーク
153
PR マージ指標
30日以内にマージされた PR はありません

説明

### Short summary

When a Windows file path is pasted into the chat composer, backslashes that precede escapable ASCII punctuation are consumed, corrupting the path.

### Affected version or release

v1.1.7

### Installation context

installed from prompt on ghcp cli

### What happened?

# Windows paths pasted into the chat composer silently lose backslashes (markdown escape consumption)

**Summary:**

When a Windows file path is pasted into the chat composer, backslashes that precede escapable ASCII punctuation are consumed, corrupting the path. The corrupted path is what is sent to the assistant, so a valid path is reported back as "does not exist". This is data corruption on the send path, not a display-only rendering artifact.

The most common victim is the backslash before a dotfolder:

```
Pasted: C:\Users\user\.copilot\config.json
Received: C:\Users\user.copilot\config.json
```

**Environment:**

- App: GitHub Copilot desktop app (chat composer)
- OS: Windows 11
- Date first observed: 2026-08-11
- Does NOT reproduce in `ghcp` CLI, which handles the same paste correctly.

### Steps to reproduce

1. In File Explorer, right-click any file inside a dotfolder (for example `C:\Users\\.copilot\config.json`) and choose **Copy path**.
2. Paste into a plain text editor (Notepad, Sublime Text, VS Code) and confirm the path is intact.
3. Paste the same clipboard content into the GitHub Copilot desktop app chat composer.
4. Compare.

### Expected behavior

**Expected:**

```
"C:\Users\user\.copilot\config.json"
```

**Actual:**

```
"C:\Users\user.copilot\config.json"
```

The backslash before `.copilot` is gone.

**Analysis / likely mechanism:**

The composer appears to markdown-normalize pasted text, treating `\` + escapable ASCII punctuation as an escape sequence and consuming the backslash.

This explains why only *some* separators disappear. In `C:\Users\user\.copilot\md\updates`:

| Sequence | Valid markdown escape? | Result |
|---|---|---|
| `\U` | no | backslash kept |
| `\i` | no | backslash kept |
| `\.` | **yes** (`.` is escapable punctuation) | **backslash eaten** |
| `\m` | no | backslash kept |
| `\u` | no | backslash kept |

Predicted to affect any `\` followed by markdown-escapable punctuation. **Confirmed for both `\.` and `\_`.**

A single line exercising both triggers, confirmed to lose two backslashes:

```
Pasted: C:\_code\git\Repo\.pipelines\Official
Received: C:_code\git\Repo.pipelines\Official
```

### Additional context

**Suggested fix:**

Treat composer paste as literal plain text and do not apply markdown escape normalization to it. If markdown handling on paste is intentional, either escape the incoming backslashes so they round-trip, or detect Windows-path-shaped content and insert it verbatim.

**Possibly related:**

- #2307 - Pasting a formatted (rich text) link into chat drops the URL. Different clipboard payload, but also composer paste losing content on Windows, so it may share a root cause.
- #1115 - Allow backslash for file reference on Windows. Different surface (`@` file references), same general friction with Windows path handling.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。