Add Ctrl+C quit handling to REPL

- Add _quit_requested flag to TerminalDisplay
- Add request_quit() method to TerminalDisplay
- Handle 'ctrl_c' key in REPL input loops in both pipeline_runner.py and main.py
- When Ctrl+C is pressed, request_quit() is called which sets the flag
- The main loop checks is_quit_requested() and raises KeyboardInterrupt
This commit is contained in:
2026-03-22 16:48:05 -07:00
parent d5406a6b11
commit a050e26c03
3 changed files with 21 additions and 4 deletions

View File

@@ -986,7 +986,13 @@ def run_pipeline_mode(preset_name: str = "demo", graph_config: str | None = None
keys = display.get_input_keys(timeout=0.0)
for key in keys:
if key == "return":
if key == "ctrl_c":
# Request quit when Ctrl+C is pressed
if hasattr(display, "request_quit"):
display.request_quit()
else:
raise KeyboardInterrupt()
elif key == "return":
# Get command string before processing
cmd_str = repl_effect.state.current_command
if cmd_str: