@hackerrank/astra-cli 0.1.31 → 0.1.32

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 +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackerrank/astra-cli",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
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
@@ -265,13 +265,13 @@ export function computeVisualLines(buf, promptPrefix, cols = 80) {
265
265
  /** Check if an escape sequence or key code is a newline-insertion shortcut (Shift+Enter, Option+Enter, etc.). */
266
266
  export function isNewlineKey(s, pendingEsc = false) {
267
267
  if (!s || typeof s !== "string") return false;
268
+ // Shift+Enter, Ctrl+Enter, Alt+Enter in CSI u / modifyOtherKeys forms
268
269
  if (/^\x1b\[(?:13|10);[2-8]u$/.test(s)) return true;
269
270
  if (/^\x1b\[27;[2-8];(?:13|10)~$/.test(s)) return true;
270
271
  if (/^\x1b\[(?:13|10);[2-8]~$/.test(s)) return true;
271
272
  if (s === "\x1bOM") return true;
273
+ // Alt/Option+Enter on macOS Terminal / iTerm2
272
274
  if (s === "\x1b\r" || s === "\x1b\n" || s === "\x1b\x0d") return true;
273
- if (pendingEsc && (s === "\r" || s === "\n" || s === "\x0d" || s === "\x0a")) return true;
274
- if (s === "\x0a" || s === "\n") return true;
275
275
  return false;
276
276
  }
277
277