✨ Improve CLI UX: line editing, function-key shortcuts, and help bar
维护者通常 1 天内回复
评估
调研方向
首先定位 debugger 的 CLI 输入循环和命令解析器,然后查看 issue #168 和 PR #456 中的后续上下文。在实现行编辑、历史记录、快捷键和提示符渲染之前,先确定最终的按键映射和帮助栏颜色。完成的标准是:列出的按键可用,文本命令仍然可用,并且每个提示符都显示所公布的快捷键。
由索引模型根据 Issue 内容生成。
描述
🤖 AI text below 🤖
Problem statement
We have identified three small areas where the debugger's CLI could be significantly nicer to use. They are independent friction points but reinforce each other, so they make sense as one coherent change.
Line editing. At the prompt the cursor keys (Left, Right), Home, End, and Delete do not do what the user expects: their escape sequences reach std::getline verbatim and end up as stray bytes in the command string, which then fails to parse.
Keyboard shortcuts. Advancing through a program means typing step, back, step over, run and pressing ENTER each time. Even the short forms (b, o, bo, rb) are not that short when the debug loop is tight.
Help bar. The list of available commands is only shown when the user types something the parser does not recognize. There is no persistent reminder of what is available.
Surfaced during the follow-up work on issue #168 (PR #456).
Proposed solution
Address the three items together because they reinforce each other: making the input handler process escape sequences unlocks both cursor keys and function keys, and function keys are only worth adding if the user can see them advertised somewhere.
1. Line editing. Read input in a way that interprets the escape sequences the terminal emits for cursor navigation. Support Left/Right, Home/End, Delete, Ctrl+U (clear the line back to the start), as well as Up/Down to recall previous commands from a short in-memory history.
2. Keyboard shortcuts. Once escape sequences are being parsed, bind the most common commands to function keys and single letters so the user can advance without typing full command names. Proposed default:
| Key | Command |
|---|---|
| F5 | run |
| F6 | step |
| F7 | step over |
| F9 | run back |
| F10 | back |
| F11 | back over |
| a | assertions |
| i | inspect |
| r | reset |
| q | quit |
Textual commands remain available, so nothing regresses.
3. Help bar. Print a one-line, colored header at the top of each prompt cycle, listing the function-key shortcuts and a branding tag like MQT Debugger. Use ANSI color codes for contrast so the bar visually separates from the transcript.
For example, something like this (alternating dark and pale blue backgrounds across the width, white text throughout, shortcuts in bold):
Open questions
- Keyboard shortcuts. The table above is a starting proposal; final mapping is up to you.
- Colors for the help bar. The proposal uses the two-tone blue palette described above. If the project has an existing theming convention (design system, brand palette), the backgrounds can be swapped for the matching values.
Out of scope
- Interpreting a bare variable name as an implicit
get(e.g., typingc[0]andENTERto inspect it). Interesting idea but changes the REPL grammar and is better tracked separately. - Tab completion of debugger commands.
- Configurable key bindings via a config file.
- Broader theming (colors for state output, breakpoints, assertions).
- 主要语言
- C++
- 星标
- 21
- 派生
- 8
- 平均合并
- 5 小时 17 分钟
- 30 天内合并 PR
- 21
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
munich-quantum-toolkit/debugger 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 84/100
munich-quantum-toolkit/debugger#469 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 66/100
munich-quantum-toolkit/debugger#468 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 48/100
munich-quantum-toolkit/debugger#465 ·
维护者通常 1 天内回复
-
c++ enhancement help wanted
难度 4/5 3-5 天 新手友好度 48/100
munich-quantum-toolkit/debugger#168 ·
维护者通常 1 天内回复
-
dependencies
难度 5/5 一周以上 新手友好度 10/100
munich-quantum-toolkit/debugger#55 · 1 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
查看 munich-quantum-toolkit/debugger 的全部 Issue
相似的 Issue
-
backlog bug
难度 2/5 1-3 小时 新手友好度 75/100
EchoTools/nevr-runtime#653 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 75/100
InfiniTimeOrg/InfiniTime#2492 ·
-
accessibility good first issue hacktoberfest help wanted
难度 2/5 1-3 小时 新手友好度 74/100
OpenChemistry/avogadrolibs#3184 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
Tracktion/tracktion_engine#475 ·
维护者通常 1 天内回复