github / github/copilot-cli

[Bug] Shell command output (e.g. !git log) is impossible to scroll in alt_screen mode

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

描述

## Description

When alt_screen mode is enabled (`alt_screen: true` in config.json), running shell commands via the `!` prefix (e.g., `!git log`) produces output that is too long and difficult to scroll through.

## Steps to Reproduce

1. Enable alt_screen mode: set `alt_screen: true` in `~/.copilot/config.json`
2. Launch `copilot`
3. Run `!git log` (or any command that produces output longer than one screen)
4. Try to scroll up to see earlier output

## Expected Behavior

The output from `!git log` should be scrollable, either by:
- Piping long output through a pager (like `less`) automatically
- Temporarily switching back to the normal screen buffer for `!` command output
- Providing some other mechanism to review the full output

## Actual Behavior

The output renders in the alternate screen buffer. Once it exceeds the visible terminal height, earlier lines are gone and cannot be scrolled to. This makes commands like `git log`, `git diff`, `cat` on long files, etc. effectively unusable via the `!` prefix.

## Possible Solutions

- Automatically pipe `!` command output through a pager when in alt_screen mode
- Temporarily exit alt_screen for the duration of `!` commands, then re-enter
- Capture output and render it in a scrollable view within the CLI

## Environment

- **OS**: Windows 11
- **Copilot CLI version**: 0.0.419
- **Terminal**: Windows Terminal / PowerShell
- **Config**: `alt_screen: true`

## Workaround

Use `--no-pager` with git commands (e.g., `!git --no-pager log`) or pipe to `head`/`tail`, but this is not discoverable and defeats the purpose of interactive commands.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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