altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

[bug] Ctrl+C kills the entire session instead of canceling the current operation

Open shreyastelkar opened this issue 8 months ago • 1 comments

Problem

Pressing bare Ctrl+C sends SIGINT and terminates the entire altimate-code process, killing the session. Users instinctively press Ctrl+C to cancel a long-running tool call or abort a response — and lose their entire conversation, context, and unsaved state.

Expected behavior

  • Ctrl+C should cancel the current in-flight operation (tool call, streaming response) and return to the input prompt
  • Ctrl+D or /exit should quit the session

This is standard behavior in virtually every interactive terminal application (Python REPL, node REPL, psql, etc.).

Current behavior

  • Ctrl+C kills the entire process (SIGINT, no graceful handling)
  • Leader + Ctrl+C is the documented "Interrupt session" keybind (see keybinds docs)

The documented interrupt keybind is a two-chord sequence that most users will not discover. Bare Ctrl+C should be the interrupt, not the kill signal.

Impact

  • Users lose conversation history and context mid-session
  • Especially painful during long multi-step workflows
  • Muscle memory from every other terminal tool causes accidental session termination

shreyastelkar avatar Mar 22 '26 01:03 shreyastelkar

Title: fix: remap Ctrl+C from app_exit to session_interrupt

▎ Problem: app_exit defaults include ctrl+c, causing Ctrl+C to kill the entire process instead of canceling the
current operation. session_interrupt (interrupt/cancel) defaults to escape only, which is non-discoverable and
conflicts with muscle memory from Python REPL, Node REPL, psql, and every other interactive terminal tool.

▎ Fix: Two-line config change — remove ctrl+c from app_exit, add it to session_interrupt. Add an idle hint when Ctrl+C is pressed with no active session (à la Node.js REPL: "Press Ctrl+D to exit").

▎ Files changed: config.ts (2 lines), prompt/index.tsx (~10 lines)

utkarshsingh1102 avatar Mar 22 '26 13:03 utkarshsingh1102