@oxecli/oxe 1.0.58 → 1.0.59
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/ui.js +7 -4
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -874,9 +874,6 @@ export function isShiftEnterKey(str, key) {
|
|
|
874
874
|
seq === "\x1bOM") {
|
|
875
875
|
return true;
|
|
876
876
|
}
|
|
877
|
-
if (!key.ctrl && (str === "\n" || seq === "\n" || key.name === "linefeed")) {
|
|
878
|
-
return true;
|
|
879
|
-
}
|
|
880
877
|
return false;
|
|
881
878
|
}
|
|
882
879
|
export const isNewlineKey = isShiftEnterKey;
|
|
@@ -887,7 +884,6 @@ export function isSubmitEnterKey(str, key) {
|
|
|
887
884
|
return false;
|
|
888
885
|
const seq = key.sequence || str || "";
|
|
889
886
|
if ((key.name === "return" ||
|
|
890
|
-
key.name === "enter" ||
|
|
891
887
|
seq === "\r" ||
|
|
892
888
|
seq === "\x1b[13u" ||
|
|
893
889
|
seq === "\x1b[13;1u") &&
|
|
@@ -1374,6 +1370,13 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
1374
1370
|
repaint();
|
|
1375
1371
|
return;
|
|
1376
1372
|
}
|
|
1373
|
+
// Ctrl+J sends a bare LF (0x0a). Node reports it as name "enter" or
|
|
1374
|
+
// "linefeed" with no shift modifier. Only Shift+Enter should create a
|
|
1375
|
+
// new row, so ignore a lone LF (it is not a real Enter — a real Enter
|
|
1376
|
+
// arrives as CR / name "return").
|
|
1377
|
+
if (key && !key.shift && (key.name === "enter" || key.name === "linefeed")) {
|
|
1378
|
+
return;
|
|
1379
|
+
}
|
|
1377
1380
|
if (str) {
|
|
1378
1381
|
const isPaste = str.length > 1;
|
|
1379
1382
|
insert(str.replace(/\r\n/g, "\n").replace(/\r/g, "\n"), isPaste);
|