@hackerrank/astra-cli 0.1.28 → 0.1.30

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/repl.js +9 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackerrank/astra-cli",
3
- "version": "0.1.28",
3
+ "version": "0.1.30",
4
4
  "description": "Minimal zero-dependency AI coding agent for the HackerRank AI Gateway.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/repl.js CHANGED
@@ -329,8 +329,6 @@ export class Screen {
329
329
  this.out.write(`\x1b[1;${this.scrollBottom}r`); // scroll region = top area
330
330
  this.out.write(`\x1b[${this.scrollBottom};1H`); // cursor at bottom of scroll area
331
331
  this.out.write("\x1b[?2004h"); // enable bracketed paste mode
332
- this.out.write("\x1b[>4;2m"); // enable modifyOtherKeys
333
- this.out.write("\x1b[=1u"); // enable kitty keyboard protocol
334
332
  if (this.inp.isTTY) this.inp.setRawMode(true);
335
333
  this.inp.resume();
336
334
  this.inp.setEncoding("utf8");
@@ -343,8 +341,6 @@ export class Screen {
343
341
  this.inp.off("data", this._onData);
344
342
  this.out.off("resize", this._onResize);
345
343
  if (this.inp.isTTY) this.inp.setRawMode(false);
346
- this.out.write("\x1b[>4;0m"); // disable modifyOtherKeys
347
- this.out.write("\x1b[=0u"); // disable kitty keyboard protocol
348
344
  this.out.write("\x1b[?2004l"); // disable bracketed paste mode
349
345
  this.out.write("\x1b[r"); // reset scroll region
350
346
  this.out.write(`\x1b[${this.rows};1H\n`); // move below footer
@@ -490,6 +486,15 @@ export class Screen {
490
486
  this.log(`\x1b[35m[keydebug] ${bytes}\x1b[0m`);
491
487
  }
492
488
 
489
+ // Ctrl+C handling (immediate fast path)
490
+ if (s === "\x03" || s === "\x1b[99;5u" || s === "\x1b[27;5;99~") {
491
+ this._clearEscLatch();
492
+ const r = this.resolve; this.resolve = null;
493
+ if (r) r("__SIGINT__");
494
+ if (this.onInterrupt) this.onInterrupt();
495
+ return;
496
+ }
497
+
493
498
  // Bracketed paste handling (pasting multi-line blocks into the input)
494
499
  let str = s;
495
500
  if (str.includes("\x1b[200~") || this._inPaste) {