/cwd does not strip surrounding quotes from pasted Windows paths (Explorer "Copy as path")
Nessuno ha ancora preso questa issue.
- Lingua principale
- Shell
- Stelle
- 11.2k
- Fork
- 1.9k
- Merge medio
- 14h 16m
- PR unite (30g)
- 6
Descrizione
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
- 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"). - In Copilot CLI, type
/cwdand 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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dal punto di ingresso della risoluzione dei percorsi del comando /cwd e riproduci il problema su Windows con un percorso tra virgolette ottenuto da “Copy as path” di Explorer. Il lavoro è completato quando le virgolette singole o doppie circostanti vengono rimosse prima della risoluzione, la directory assoluta tra virgolette funziona e i percorsi esistenti non racchiusi tra virgolette contenenti spazi continuano a funzionare.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- shell
- Ambito
- cli
- Tipo di issue
- Bug
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 72/100