@oxecli/oxe 1.0.37 → 1.0.39
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 +14 -1
- package/package.json +1 -1
package/dist/ui.js
CHANGED
|
@@ -777,6 +777,9 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
777
777
|
readline.emitKeypressEvents(process.stdin);
|
|
778
778
|
if (process.stdin.isTTY) {
|
|
779
779
|
process.stdin.setRawMode(true);
|
|
780
|
+
// Ask the terminal to wrap clipboard input in explicit paste markers.
|
|
781
|
+
// This makes embedded newlines unambiguous instead of relying on timing.
|
|
782
|
+
process.stdout.write("\x1b[?2004h");
|
|
780
783
|
// Enable the kitty keyboard protocol (CSI u) so Windows Terminal / modern
|
|
781
784
|
// terminals send distinct sequences for Shift+Enter / Ctrl+Enter
|
|
782
785
|
// (\x1b[13;<mod>u) instead of an indistinguishable plain \r.
|
|
@@ -808,6 +811,7 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
808
811
|
if (done)
|
|
809
812
|
return;
|
|
810
813
|
done = true;
|
|
814
|
+
process.stdout.write("\x1b[?2004l");
|
|
811
815
|
process.stdin.setRawMode(false);
|
|
812
816
|
if (pasteBurstTimer)
|
|
813
817
|
clearTimeout(pasteBurstTimer);
|
|
@@ -1139,11 +1143,20 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
1139
1143
|
pasteBurstTimer = setTimeout(() => {
|
|
1140
1144
|
pasteBurst = false;
|
|
1141
1145
|
pasteBurstTimer = null;
|
|
1142
|
-
},
|
|
1146
|
+
}, 500);
|
|
1143
1147
|
};
|
|
1144
1148
|
const onKeypress = (str, key) => {
|
|
1145
1149
|
if (consumeBracketedPaste(str, key))
|
|
1146
1150
|
return;
|
|
1151
|
+
// A normal typed character after an unbracketed paste ends the fallback
|
|
1152
|
+
// window, so the next Enter can submit immediately. Multi-character
|
|
1153
|
+
// clipboard chunks keep the window alive until their rows arrive.
|
|
1154
|
+
if (pasteBurst && str && str.length === 1 && !key?.ctrl && !key?.meta) {
|
|
1155
|
+
pasteBurst = false;
|
|
1156
|
+
if (pasteBurstTimer)
|
|
1157
|
+
clearTimeout(pasteBurstTimer);
|
|
1158
|
+
pasteBurstTimer = null;
|
|
1159
|
+
}
|
|
1147
1160
|
if (key && key.ctrl && key.name === "c") {
|
|
1148
1161
|
settle(new Error("interrupt"), true);
|
|
1149
1162
|
return;
|