erosolar-cli 2.1.211 → 2.1.212

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1069,22 +1069,32 @@ export class InteractiveShell {
1069
1069
  this.syncRendererInput();
1070
1070
  }
1071
1071
  /**
1072
- * Handle Ctrl+C presses in three stages:
1073
- * 1) Clear chat box text
1074
- * 2) Pause/interrupt AI execution (even while streaming)
1075
- * 3) Quit the program
1072
+ * Handle Ctrl+C presses with context-aware behavior:
1073
+ * - If buffer has text: clear the buffer first
1074
+ * - If buffer is empty and AI is running: first Ctrl+C pauses AI, second quits
1075
+ * - If buffer is empty and AI is idle: first Ctrl+C shows hint, second quits
1076
1076
  */
1077
1077
  handleCtrlCPress(hadBuffer) {
1078
1078
  this.ctrlCHandledThisPress = true;
1079
- this.ctrlCPressCount = Math.min(this.ctrlCPressCount + 1, 3);
1080
- if (this.ctrlCPressCount === 1) {
1081
- this.clearChatInput();
1079
+ if (hadBuffer) {
1080
+ // Buffer had text, it was cleared by the renderer - reset the counter
1081
+ this.ctrlCPressCount = 0;
1082
1082
  return;
1083
1083
  }
1084
- if (this.ctrlCPressCount === 2) {
1085
- this.pauseAiExecution();
1084
+ // Buffer is empty - increment counter for pause/quit sequence
1085
+ this.ctrlCPressCount = Math.min(this.ctrlCPressCount + 1, 2);
1086
+ if (this.ctrlCPressCount === 1) {
1087
+ // First Ctrl+C with empty buffer: pause AI if running, otherwise show hint
1088
+ if (this.isProcessing && this.agent) {
1089
+ this.agent.requestCancellation();
1090
+ display.showWarning('Pausing AI execution... (press Ctrl+C again to quit)');
1091
+ }
1092
+ else {
1093
+ display.showInfo('Press Ctrl+C again to quit');
1094
+ }
1086
1095
  return;
1087
1096
  }
1097
+ // Second Ctrl+C with empty buffer: quit
1088
1098
  this.shutdown();
1089
1099
  }
1090
1100
  pauseAiExecution() {