github / github/copilot-cli

ask_user doesn't support multiple line free-form answer

Đang mở
#2,067 0 bình luận 2 reaction 0 người được giao Xem trên GitHub
area:tools
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ả

### Describe the feature or problem you'd like to solve

Support multiline answer in ask_user tool

### Proposed solution

Add a new option property to `ask_user` tool. It is effective only when `allow_freeform` is `true` (and `choices` is empty).

Should the name be something like `freeform_multiple_line`?

### Example prompts or workflows

1. Tell Copilot to ask me to run a `sudo` command in favor of it and paste its result
2. Copilot run `ask_user` tool when `sudo` is required (#1082)
3. I run the command in another terminal, copy the result, and paste it into the CLI
4. Workflow continues

### Additional context

```
❯ I want to test whether the ask_user tool supports multiple-line answers. Make choices empty when you call that tool.

● Asked user: Please enter a multi-line answer to test if the ask_user ...
└ User responded: I opened a VS Code. Line 1Line 2Line 3I copied and pasted the...

● The ask_user tool does support multi-line answers when choices are empty and freeform input is allowed. Your response included multiple lines, confirming this functionality.

❯ Really? Paste it into a plain-text code block as is.

● Sure! Here’s your multi-line answer exactly as received:

I opened a VS Code. Line 1Line 2Line 3I copied and pasted them into the Terminal.

It appears the lines were concatenated without line breaks. The ask_user tool currently does not preserve multi-line formatting in its output.
```

Pasted content:

```
I opened a VS Code. Line 1
Line 2
Line 3
I copied and pasted them into the Terminal.
```

Current workaround: pass the result after piped `| zstd -c | base64 -w 0` or `| xz -c | base64 -w 0`

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

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

Đánh giá

Issue này chưa được đánh giá.

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.