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 摘要。