π€ 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., 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).
π€ 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, andDeletedo not do what the user expects: their escape sequences reachstd::getlineverbatim 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,runand pressingENTEReach 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 asUp/Downto 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:
runstepstep overrun backbackback overassertionsinspectresetquitTextual 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
Out of scope
get(e.g., typingc[0]andENTERto inspect it). Interesting idea but changes the REPL grammar and is better tracked separately.