Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

✨ Improve CLI UX: line editing, function-key shortcuts, and help bar

未关闭
#467 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@rturrado 已经在做这个了。

开始于 2026年9月14日。

  • #482 来自 @rturrado —— 未关闭

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
cli, devtools

调研方向

首先定位 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):

Image
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., typing c[0] and ENTER to 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

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

munich-quantum-toolkit/debugger 的其他 Issue

查看 munich-quantum-toolkit/debugger 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

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