github / github/copilot-cli

Collapsible output sections per type (thinking, command output, tool calls, messages) with colour-coded type indicators

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

描述

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

During a complex agent session, the scrollback fills up rapidly with a mix of very different content types — reasoning/thinking blocks, tool/command output, background task results, and the agent's final message. These are all rendered as a flat, undifferentiated stream. There is no way to collapse a 200-line command output you've already read, fold away a long thinking block, or visually distinguish at a glance what type of content each section is. Navigating a long session becomes increasingly unwieldy as output accumulates.

### Proposed solution

Make each discrete output section independently collapsible, with colour-coded type indicators so the nature of each block is immediately recognisable.

**Collapsible sections — toggle individually or all at once:**

| Section type | Collapse behaviour |
|---|---|
| 💭 **Thinking / reasoning** | Fold to a single summary line (e.g. `💭 Thinking [~340 tokens] ▶ expand`) |
| ⚙ **Tool call / command output** | Fold to tool name + exit code (e.g. `⚙ pwsh ✔ ▶ expand`) |
| 🤖 **Background / worker task** | Fold to agent type + status (e.g. `🤖 explore ✔ done ▶ expand`) |
| 💬 **Agent message** | Collapsible but shown expanded by default |

**Keyboard controls:**
- `←` / `→` (or `z`) on a focused section — collapse / expand that section
- `Ctrl+←` / `Ctrl+→` — collapse / expand **all** sections of that type at once
- `Ctrl+Shift+←` — collapse **everything** in the scrollback (clean slate view)
- `Ctrl+Shift+→` — expand everything

**Colour-coded leading indicators** (respects terminal theme / AUTO palette):

```
💭 [dim purple] Thinking
⚙ [dim yellow] Tool call / command
🤖 [dim cyan] Background task / worker agent
💬 [white] Agent message
✖ [red] Error / failure
```

Collapsed sections render as a single muted line with a `▶` expand arrow. Expanded sections show the `▼` arrow. Users who prefer a minimal UI can set `"collapsibleOutput": false` in `config.json` to revert to the current flat rendering.

### Example prompts or workflows

1. Agent produces a 300-line `npm test` output. User reads it, then collapses it with `←` — one line remains, scrollback is clean.
2. User wants to hide all thinking blocks for the session — `Ctrl+←` on any thinking block collapses every thinking section at once.
3. User glances at the colour indicators to quickly scan which turns involved tool calls vs. pure reasoning vs. final answers — without reading a single word.
4. User runs `Ctrl+Shift+←` to collapse all output after a long session, then selectively re-expands only the sections they want to revisit.
5. User disables the feature entirely via config — output renders exactly as it does today.

### Additional context

- OS: Windows 11 Pro (Build 26200 / 24H2)
- Shell: PowerShell 7.5.4
- Copilot CLI: 0.0.420 (win32-x64)
- Thinking blocks are already visually separated in some form in the current UI — this extends that into full interactivity.
- The colour indicator system should integrate with the existing `AUTO` theme so colours adapt correctly to any terminal colour scheme.
- This is a significant UX improvement for long or complex sessions where the scrollback becomes the primary navigation challenge.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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