hedgequantx 1.8.16 → 1.8.17

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "1.8.16",
3
+ "version": "1.8.17",
4
4
  "description": "Prop Futures Algo Trading CLI - Connect to Topstep, Alpha Futures, and other prop firms",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -6,12 +6,27 @@
6
6
  const inquirer = require('inquirer');
7
7
 
8
8
  /**
9
- * Ensure stdin is ready
9
+ * Ensure stdin is ready and clear any buffered input
10
10
  */
11
11
  const prepareStdin = () => {
12
12
  try {
13
+ // Resume if paused
13
14
  if (process.stdin.isPaused()) process.stdin.resume();
14
- if (process.stdin.isTTY && process.stdin.isRaw) process.stdin.setRawMode(false);
15
+
16
+ // Ensure raw mode is off for line-based input
17
+ if (process.stdin.isTTY && process.stdin.setRawMode) {
18
+ process.stdin.setRawMode(false);
19
+ }
20
+
21
+ // Clear any buffered data by removing all listeners temporarily
22
+ const listeners = process.stdin.listeners('data');
23
+ process.stdin.removeAllListeners('data');
24
+
25
+ // Drain any pending input
26
+ process.stdin.read();
27
+
28
+ // Restore listeners
29
+ listeners.forEach(l => process.stdin.on('data', l));
15
30
  } catch (e) {}
16
31
  };
17
32