@oxecli/oxe 1.0.65 → 1.0.66

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.
package/dist/cli.js CHANGED
@@ -466,7 +466,10 @@ export class CLI {
466
466
  this.story[this.story.length - 1]["type"] === "user") {
467
467
  this.story.pop();
468
468
  }
469
- if (this.interruptPending) {
469
+ // Exit cleanly on: a second Ctrl+C, or a first Ctrl+C while idle
470
+ // (no active query). Only an in-flight query's first Ctrl+C keeps
471
+ // running so the agent can be interrupted without a stray key exiting.
472
+ if (this.interruptPending || !wasActive) {
470
473
  this.saveSession(engine);
471
474
  await engine.cleanupStoredResponses();
472
475
  process.stdout.write("\nClosing terminal session. Goodbye!\n\n");
@@ -474,9 +477,7 @@ export class CLI {
474
477
  }
475
478
  this.interruptPending = true;
476
479
  process.stdout.write("\n");
477
- process.stdout.write(wasActive
478
- ? "\x1b[2mInterrupted agent. Press Ctrl+C again to exit, or type a new prompt.\x1b[0m\n"
479
- : "\x1b[2mNo active query. Press Ctrl+C again to exit.\x1b[0m\n");
480
+ process.stdout.write("\x1b[2mInterrupted agent. Press Ctrl+C again to exit, or type a new prompt.\x1b[0m\n");
480
481
  continue;
481
482
  }
482
483
  throw err;
package/dist/ui.js CHANGED
@@ -9,7 +9,7 @@ export function enableRawStdin() {
9
9
  readline.emitKeypressEvents(process.stdin);
10
10
  if (process.stdin.isTTY) {
11
11
  process.stdin.setRawMode(true);
12
- process.stdout.write("\x1b[<u\x1b[>1u");
12
+ process.stdout.write("\x1b[>1u");
13
13
  }
14
14
  process.stdin.resume();
15
15
  hideCursor();
@@ -995,10 +995,10 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
995
995
  if (process.stdin.isTTY) {
996
996
  process.stdin.setRawMode(true);
997
997
  process.stdout.write("\x1b[?2004h");
998
- // Enable CSI-u "disambiguate" so the terminal reports Shift+Enter as a
999
- // distinct code (`ESC [ 13 ; 2 u`) instead of collapsing it into a plain
1000
- // Enter. Pop any prior mode, then push flags=1 (disambiguate).
1001
- process.stdout.write("\x1b[<u\x1b[>1u");
998
+ // Enable CSI-u "disambiguate" (flags=1) so a terminal that supports it
999
+ // reports Shift+Enter as a distinct `ESC [ 13 ; 2 u` code instead of
1000
+ // collapsing it into a plain Enter.
1001
+ process.stdout.write("\x1b[>1u");
1002
1002
  }
1003
1003
  process.stdin.resume();
1004
1004
  hideCursor();
@@ -1028,6 +1028,7 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
1028
1028
  clearBox();
1029
1029
  process.stdin.removeListener("keypress", onKeypress);
1030
1030
  process.stdin.pause();
1031
+ showCursor();
1031
1032
  if (isErr)
1032
1033
  reject(value);
1033
1034
  else
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.65",
3
+ "version": "1.0.66",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },