@oxecli/oxe 1.0.67 → 1.0.68

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/dist/ui.js +12 -0
  2. package/package.json +1 -1
package/dist/ui.js CHANGED
@@ -1136,6 +1136,7 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
1136
1136
  // `\x1b[27;2;13~`), which Node's readline splits into several keypress
1137
1137
  // events instead of one, so they must be reassembled here.
1138
1138
  let modSeq = "";
1139
+ let modSeqTimeout = null;
1139
1140
  readline.emitKeypressEvents(process.stdin);
1140
1141
  if (process.stdin.isTTY) {
1141
1142
  process.stdin.setRawMode(true);
@@ -1170,6 +1171,8 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
1170
1171
  process.stdin.setRawMode(false);
1171
1172
  if (pasteBurstTimer)
1172
1173
  clearTimeout(pasteBurstTimer);
1174
+ if (modSeqTimeout)
1175
+ clearTimeout(modSeqTimeout);
1173
1176
  clearBox();
1174
1177
  process.stdin.removeListener("keypress", onKeypress);
1175
1178
  process.stdin.pause();
@@ -1595,12 +1598,21 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
1595
1598
  if (/^\x1b\[[\d;]*[a-zA-Z~_u]$/.test(modSeq)) {
1596
1599
  const full = modSeq;
1597
1600
  modSeq = "";
1601
+ if (modSeqTimeout)
1602
+ clearTimeout(modSeqTimeout);
1603
+ modSeqTimeout = null;
1598
1604
  handleRawSequence(full);
1599
1605
  }
1600
1606
  return;
1601
1607
  }
1602
1608
  if (/^\x1b\[[\d;]*$/.test(seq)) {
1603
1609
  modSeq = seq;
1610
+ if (modSeqTimeout)
1611
+ clearTimeout(modSeqTimeout);
1612
+ modSeqTimeout = setTimeout(() => {
1613
+ modSeq = "";
1614
+ modSeqTimeout = null;
1615
+ }, 200);
1604
1616
  return;
1605
1617
  }
1606
1618
  if (consumeBracketedPaste(str, key))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxecli/oxe",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },