/cwd does not strip surrounding quotes from pasted Windows paths (Explorer "Copy as path")
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Shell
- Star
- 11.2k
- Fork
- 1.9k
- Merge trung bình
- 14 giờ 16 phút
- Pull request đã merge (30 ngày)
- 6
Mô tả
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.
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu tại điểm vào xử lý phân giải đường dẫn của lệnh /cwd và tái hiện vấn đề trên Windows bằng một đường dẫn được đặt trong dấu ngoặc kép từ “Copy as path” của Explorer. Được xem là hoàn tất khi các dấu ngoặc đơn hoặc ngoặc kép bao quanh được loại bỏ trước khi phân giải, thư mục tuyệt đối được đặt trong dấu ngoặc hoạt động thành công và các đường dẫn hiện có không được đặt trong dấu ngoặc nhưng chứa khoảng trắng vẫn tiếp tục hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- shell
- Lĩnh vực
- cli
- Loại issue
- Lỗi
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 72/100