@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.
- package/package.json +1 -1
- package/src/repl.js +2 -2
package/package.json
CHANGED
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
|
|