github / github/copilot-cli

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

Offen Anfängerfreundlich
#4,426 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

area:input-keyboard area:platform-windows
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne am Einstiegspunkt für die Pfadauflösung des Befehls /cwd und reproduziere das Problem unter Windows mit einem in Anführungszeichen gesetzten Pfad aus Explorers „Copy as path“. Als erledigt gilt die Aufgabe, wenn umschließende einfache oder doppelte Anführungszeichen vor der Auflösung entfernt werden, das in Anführungszeichen gesetzte absolute Verzeichnis erfolgreich verwendet werden kann und vorhandene Pfade mit Leerzeichen ohne Anführungszeichen weiterhin funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
shell
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
72/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.