hedgequantx 1.3.7 → 1.3.8

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.3.7",
3
+ "version": "1.3.8",
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": {
@@ -113,6 +113,10 @@ const dashboardMenu = async (service) => {
113
113
  console.log(chalk.cyan('╚' + '═'.repeat(W) + '╝'));
114
114
  console.log();
115
115
 
116
+ // Small delay to ensure stdin is ready
117
+ await new Promise(resolve => setTimeout(resolve, 50));
118
+ prepareStdin();
119
+
116
120
  const { action } = await inquirer.prompt([
117
121
  {
118
122
  type: 'input',
package/src/ui/index.js CHANGED
@@ -29,11 +29,32 @@ const { createBoxMenu } = require('./menu');
29
29
  * This fixes input leaking to bash after session restore or algo trading
30
30
  */
31
31
  const prepareStdin = () => {
32
- // Minimal intervention - just ensure stdin is flowing
33
32
  try {
33
+ // Ensure stdin is flowing
34
34
  if (process.stdin.isPaused()) {
35
35
  process.stdin.resume();
36
36
  }
37
+
38
+ // Reset stdin to proper state for inquirer
39
+ if (process.stdin.isTTY) {
40
+ // Disable raw mode if it was left on
41
+ if (process.stdin.isRaw) {
42
+ process.stdin.setRawMode(false);
43
+ }
44
+ }
45
+
46
+ // Clear any buffered input by removing old listeners temporarily
47
+ const oldListeners = process.stdin.listeners('data');
48
+ process.stdin.removeAllListeners('data');
49
+
50
+ // Restore listeners after a tick
51
+ setImmediate(() => {
52
+ oldListeners.forEach(listener => {
53
+ if (!process.stdin.listeners('data').includes(listener)) {
54
+ process.stdin.on('data', listener);
55
+ }
56
+ });
57
+ });
37
58
  } catch (e) {
38
59
  // Ignore errors
39
60
  }