munich-quantum-toolkit / munich-quantum-toolkit/debugger

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

Open
#467 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
21
Forks
7
Avg merge
9h 28m
Merged PRs (30d)
42

Description

🤖 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).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the debugger's CLI input loop and command parser, then review the follow-up context in issue #168 and PR #456. Define the final key mappings and help-bar colors before implementing line editing, history, shortcuts, and prompt rendering. Done means the listed keys work, textual commands remain available, and each prompt shows the advertised shortcuts.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.