github / github/copilot-cli

Markdown blockquotes wrap mid-sentence and orphan words onto their own line

未关闭
#3,193 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
area:terminal-rendering
主要语言
Shell
星标
11.2k
派生
1.9k
平均合并
14 小时 16 分钟
30 天内合并 PR
6

描述

## Description

When the agent's response contains a markdown blockquote (`> ...`) that runs longer than the terminal width, the renderer wraps the line in a way that puts the last word or two of a sentence onto its own line, with the rest of the paragraph continuing on a subsequent line. This makes the output look broken and is hard to copy-paste cleanly into another app (Slack, email, GitHub comment).

It happens consistently with blockquoted paragraphs of more than ~1.5 terminal lines. I've hit it in many sessions over several months across different repos and tasks. Asking the agent to "stop using blockquotes" works as a session-local workaround, but the underlying renderer behaviour is the bug.

## Steps to reproduce

1. In a terminal of any width (seen at 120 and 180 chars).
2. Ask the agent to draft a message, comment, or email so it produces a markdown blockquote with at least two sentences:

```
> Thanks Dave. Dropped an issue on the repo with the detail.
>
> Short version: we're early days on this, still designing and building, no real traffic yet. The one thing we know for certain is that both our inbound and outbound HTTP will be with external vendors, so getting a clean way to tag spans and metrics with the caller (inbound) and the target (outbound) from day one is what we're after, rather than retrofitting it later. Happy to jump on the chat you set up whenever suits.
```

## Expected behaviour

Blockquote wraps cleanly at word boundaries near the right margin, like a normal paragraph would.

## Actual behaviour

Words near the end of a logical line get pushed onto their own line, leaving large blank gaps. Example from a real session:

```
Short version: we're early days on this, still designing and building, no real traffic yet. The one thing we know for certain is that both our inbound and outbound HTTP will be with external vendors, so
getting
a clean way to tag spans and metrics with the caller (inbound) and the target (outbound) from day one is what we're after, rather than retrofitting it later. Happy to jump on the chat you set up whenever
suits.
```

Note `getting` and `suits` end up alone on a line with leading whitespace.

## Environment

- CLI version: `1.0.34`
- OS: macOS (Darwin)
- Terminal: Ghostty
- Frequency: every session that uses blockquotes for prose

## Additional context

- Numbered lists and bullet lists render fine for me at the same widths.
- Plain paragraphs (no `> `) render fine.
- Code fences render fine.
- The issue is specific to blockquoted prose.

贡献指南

打开贡献指南

调研方向

首先,在终端宽度为 120 和 180 时,使用提供的块引用文本在 CLI 中复现该问题,然后跟踪 Markdown 块引用的渲染和换行路径。将其与普通段落、有序列表、无序列表和代码围栏进行比较;据报告,这些内容的渲染都是正确的。完成的标准是:块引用文本在单词边界处换行,不出现孤立单词或大段空白,同时保留其他内容现有的正确行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
shell
领域
cli
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。