github / github/copilot-cli

/cwd does not strip surrounding quotes from pasted Windows paths (Explorer "Copy as path")

Open Beginner friendly
#4,426 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:input-keyboard area:platform-windows
Dominant language
Shell
Stars
11.2k
Forks
1.9k
Avg merge
14h 16m
Merged PRs (30d)
6

Description

Description

When pasting a Windows path that is wrapped in double quotes (the format produced by Windows Explorer's Copy as path, e.g. "C:\Users\me\My Folder"), the /cwd command treats the quotes as literal characters. The quoted string is then interpreted as a relative path and appended to the current working directory, so the command fails even though the target directory exists.

Steps to reproduce

  1. In Windows Explorer, right-click a folder → Copy as path (yields a quoted path like "C:\Users\russell.adams\OneDrive - Layfield Group\Scripts\LFG Efforts\CMMC").
  2. In Copilot CLI, type /cwd and paste.

Actual behavior

Failed to change directory: Error: Directory does not exist or cannot be accessed: C:\Users\russell.adams\"C:\Users\russell.adams\OneDrive - Layfield Group\Scripts\LFG Efforts\CMMC"

The quoted absolute path is concatenated onto the current cwd instead of being recognized as an absolute path.

Expected behavior

/cwd should strip surrounding single/double quotes from the argument before resolving it, so paths pasted via "Copy as path" work directly. (Unquoted paths with spaces already work fine.)

Environment

  • Copilot CLI version: 1.0.78
  • OS: Windows (Windows_NT)

Workaround

Manually delete the surrounding quotes before submitting the /cwd command.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the /cwd command's path-resolution entry point and reproduce the issue on Windows with a quoted path from Explorer's “Copy as path”. Done means surrounding single or double quotes are removed before resolution, the quoted absolute directory succeeds, and existing unquoted paths with spaces continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.