github / github/copilot-cli

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

Đang mở Phù hợp với người mới
#4,426 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

area:input-keyboard area:platform-windows
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

  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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. 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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.