建议增加滚动条和指令预览 #7557

Open
opened 2026-02-16 18:07:35 -05:00 by yindo · 1 comment
Owner

Originally created by @zhong2025001 on GitHub (Jan 25, 2026).

Originally assigned to: @kommander on GitHub.

🎯 问题描述
当使用 OpenCode 处理复杂任务时,Terminal User Interface (TUI) 会显示大量的交互信息。在 Windows PowerShell 环境下,缺少滚动条和快速导航功能,导致:

  1. 信息过长时无法快速定位:历史对话记录堆积,难以找到特定位置
  2. 指令预览缺失:无法快速浏览和重用之前的命令
  3. 导航效率低:只能通过 PageUp/PageDown 逐页翻阅
  4. 用户体验差:长时间使用时容易迷失在大量信息中
    🛠️ 建议方案 --- 注:方案由opencode自动生成。
    方案 A: 滚动条 + 指令历史面板
    ┌─ OpenCode v1.1.34 ── GPT-5 Nano ─────────────────┐
    │ │
    │ 对话区域 │
    │ > 用户: 解释这段代码 │
    🤖 AI: 这是一个函数... │
    │ │
    │ 滚动条 ██████████░░░░░░░░░░ 60% │
    │ │
    │ 指令历史侧边栏 │
    │ !ls -la │
    │ /models │
    │ help │
    │ /export │
    └────────────────────────────────────────────────┘

方案 B: 命令模式 + 快速跳转

  • 新增快捷键 Ctrl+R 打开命令历史搜索
  • 支持 Ctrl+G <行号> 快速跳转到指定位置
  • Ctrl+H 切换显示/隐藏历史对话

方案 C: 分屏模式

  • Ctrl+S 切换分屏布局
  • 左侧:当前对话
  • 右侧:指令历史和快速操作面板

🎮 具体实现建议

快捷键设计:

  • Ctrl+R: 打开命令历史搜索
  • Ctrl+G: 行号跳转
  • Ctrl+H: 历史对话切换
  • Ctrl+J/K: 历史记录上下导航
  • F3: 搜索下一个
  • Shift+F3: 搜索上一个

UI改进:

  1. 右侧滚动条: 实时显示当前位置
  2. 迷你地图: 显示对话结构概览
  3. 指令高亮: 命令和响应用不同颜色区分
  4. 状态栏: 显示当前行数/总行数

PowerShell特定优化:

  • 兼容 Windows Console Host
  • 适配 PowerShell 5.1+ 字符渲染
  • 支持 Windows Terminal 的现代化特性

🔄 替代方案考虑

  1. 渐进式增强: 先实现滚动条,再添加指令预览
  2. 配置驱动: 通过 config.json 让用户自定义快捷键
  3. 插件化: 将导航功能做成可选插件

💡 用户场景

场景1: 代码审查

用户在审查长代码对话时,需要快速回到某个特定代码段的讨论位置。

场景2: 调试会话

在长时间的调试过程中,需要回顾之前的错误信息和解决方案。

场景3: 学习回顾

学习新概念时,想要快速翻到关键解释部分重新理解。

🔧 技术实现思路

// 伪代码示例
class TUIEnhancer {
  constructor() {
    this.scrollbar = new Scrollbar()
    this.commandHistory = new CommandHistory()
    this.searchEngine = new SearchEngine()
  }
  
  enableScrolling() {
    // 实现平滑滚动
  }
  
  showCommandPreview() {
    // 显示指令历史侧边栏
  }
  
  quickJump(lineNumber) {
    // 快速跳转到指定行
  }
}
📊 优先级评估
- 影响用户: 所有 Windows PowerShell 用户
- 使用频率: 每次使用都会受益
- 实现复杂度: 中等
- 向后兼容: 完全兼容现有功能
🌟 相关Issue
- 搜索现有Issue避免重复
- 参考: 如果有类似的UI改进请求
📝 环境信息
- OS: Windows PowerShell 5.1.22621.4391
- OpenCode版本: 1.1.34
- 模型: opencode/gpt-5-nano
- 终端: Windows Console Host
🎯 预期效果
1. 导航效率提升 50%+
2. 减少信息查找时间
3. 提升长时间使用的舒适度
4. 增强专业开发者体验
Originally created by @zhong2025001 on GitHub (Jan 25, 2026). Originally assigned to: @kommander on GitHub. 🎯 **问题描述** 当使用 OpenCode 处理复杂任务时,Terminal User Interface (TUI) 会显示大量的交互信息。在 Windows PowerShell 环境下,缺少滚动条和快速导航功能,导致: 1. **信息过长时无法快速定位**:历史对话记录堆积,难以找到特定位置 2. **指令预览缺失**:无法快速浏览和重用之前的命令 3. **导航效率低**:只能通过 PageUp/PageDown 逐页翻阅 4. **用户体验差**:长时间使用时容易迷失在大量信息中 🛠️ **建议方案** --- 注:方案由opencode自动生成。 **方案 A: 滚动条 + 指令历史面板** ┌─ OpenCode v1.1.34 ── GPT-5 Nano ─────────────────┐ │ │ │ 对话区域 │ │ > 用户: 解释这段代码 │ │ 🤖 AI: 这是一个函数... │ │ │ │ 滚动条 ██████████░░░░░░░░░░ 60% │ │ │ │ 指令历史侧边栏 │ │ !ls -la │ │ /models │ │ help │ │ /export │ └────────────────────────────────────────────────┘ #### **方案 B: 命令模式 + 快速跳转** - 新增快捷键 `Ctrl+R` 打开命令历史搜索 - 支持 `Ctrl+G <行号>` 快速跳转到指定位置 - `Ctrl+H` 切换显示/隐藏历史对话 #### **方案 C: 分屏模式** - `Ctrl+S` 切换分屏布局 - 左侧:当前对话 - 右侧:指令历史和快速操作面板 ### 🎮 **具体实现建议** #### **快捷键设计:** - `Ctrl+R`: 打开命令历史搜索 - `Ctrl+G`: 行号跳转 - `Ctrl+H`: 历史对话切换 - `Ctrl+J/K`: 历史记录上下导航 - `F3`: 搜索下一个 - `Shift+F3`: 搜索上一个 #### **UI改进:** 1. **右侧滚动条**: 实时显示当前位置 2. **迷你地图**: 显示对话结构概览 3. **指令高亮**: 命令和响应用不同颜色区分 4. **状态栏**: 显示当前行数/总行数 #### **PowerShell特定优化:** - 兼容 Windows Console Host - 适配 PowerShell 5.1+ 字符渲染 - 支持 Windows Terminal 的现代化特性 ### 🔄 **替代方案考虑** 1. **渐进式增强**: 先实现滚动条,再添加指令预览 2. **配置驱动**: 通过 config.json 让用户自定义快捷键 3. **插件化**: 将导航功能做成可选插件 ### 💡 **用户场景** #### **场景1: 代码审查** 用户在审查长代码对话时,需要快速回到某个特定代码段的讨论位置。 #### **场景2: 调试会话** 在长时间的调试过程中,需要回顾之前的错误信息和解决方案。 #### **场景3: 学习回顾** 学习新概念时,想要快速翻到关键解释部分重新理解。 ### 🔧 **技术实现思路** ```javascript // 伪代码示例 class TUIEnhancer { constructor() { this.scrollbar = new Scrollbar() this.commandHistory = new CommandHistory() this.searchEngine = new SearchEngine() } enableScrolling() { // 实现平滑滚动 } showCommandPreview() { // 显示指令历史侧边栏 } quickJump(lineNumber) { // 快速跳转到指定行 } } 📊 优先级评估 - 影响用户: 所有 Windows PowerShell 用户 - 使用频率: 每次使用都会受益 - 实现复杂度: 中等 - 向后兼容: 完全兼容现有功能 🌟 相关Issue - 搜索现有Issue,避免重复 - 参考: 如果有类似的UI改进请求 📝 环境信息 - OS: Windows PowerShell 5.1.22621.4391 - OpenCode版本: 1.1.34 - 模型: opencode/gpt-5-nano - 终端: Windows Console Host 🎯 预期效果 1. 导航效率提升 50%+ 2. 减少信息查找时间 3. 提升长时间使用的舒适度 4. 增强专业开发者体验
yindo added the windowsopentui labels 2026-02-16 18:07:35 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 25, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #10345: Terminal long output lacks scrollbar for quick navigation
  • #9929: Does open code have scroll bar? (closed duplicate)
  • #9930: Add configurable scrollback/message limit to reduce TUI lag

Additionally, since your feature request includes several keyboard shortcuts (Ctrl+R, Ctrl+G, Ctrl+H, Ctrl+J/K, F3, Shift+F3), please also check our pinned keybinds documentation: #4997

Related Windows PowerShell compatibility issues:

  • #10538: Ctrl-C doesn't clear the input on Windows, it crashes
  • #10265: Ctrl+C during response causes terminal to print endless garbage
  • #10053: 终端渲染问题,TUI显示错位 (Terminal rendering/display misalignment)
  • #10491: Fix CJK character display issues in Windows terminals

Related TUI layout and navigation improvements:

  • #9955: TUI has too much padding everywhere
  • #10061: Reduce Wasted Space in TUI Header
  • #10401: Textarea cursor doesn't auto-scroll when typing long prompts

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 25, 2026): This issue might be a duplicate of existing issues. Please check: - #10345: Terminal long output lacks scrollbar for quick navigation - #9929: Does open code have scroll bar? (closed duplicate) - #9930: Add configurable scrollback/message limit to reduce TUI lag Additionally, since your feature request includes several keyboard shortcuts (Ctrl+R, Ctrl+G, Ctrl+H, Ctrl+J/K, F3, Shift+F3), please also check our pinned keybinds documentation: #4997 Related Windows PowerShell compatibility issues: - #10538: Ctrl-C doesn't clear the input on Windows, it crashes - #10265: Ctrl+C during response causes terminal to print endless garbage - #10053: 终端渲染问题,TUI显示错位 (Terminal rendering/display misalignment) - #10491: Fix CJK character display issues in Windows terminals Related TUI layout and navigation improvements: - #9955: TUI has too much padding everywhere - #10061: Reduce Wasted Space in TUI Header - #10401: Textarea cursor doesn't auto-scroll when typing long prompts Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7557