hedgequantx 2.6.80 → 2.6.81

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": "2.6.80",
3
+ "version": "2.6.81",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -386,7 +386,7 @@ class AlgoUI {
386
386
  if (this.isDrawing) return;
387
387
  this.isDrawing = true;
388
388
 
389
- // Quick hash to detect meaningful changes (skip spinner in hash)
389
+ // Quick hash to detect meaningful changes
390
390
  const statsHash = JSON.stringify({
391
391
  pnl: stats.pnl,
392
392
  openPnl: stats.openPnl,
@@ -410,8 +410,9 @@ class AlgoUI {
410
410
  this.lines = [];
411
411
 
412
412
  if (this.firstDraw) {
413
- // Enter alternate screen, hide cursor, clear once
414
- process.stdout.write('\x1B[?1049h\x1B[?25l\x1B[2J');
413
+ // Clear screen once, hide cursor
414
+ console.clear();
415
+ process.stdout.write('\x1B[?25l');
415
416
  this.firstDraw = false;
416
417
  }
417
418
 
@@ -420,13 +421,17 @@ class AlgoUI {
420
421
  this._drawStats(stats);
421
422
  this._drawLogs();
422
423
 
423
- // Build output with fixed line positions
424
+ // Build output
424
425
  const output = this.lines.join('\n');
425
426
 
426
- // Only write if content changed (reduces flicker significantly)
427
+ // Only write if content changed
427
428
  if (output !== this.lastOutput) {
428
- // Move cursor to home, then write all lines
429
- process.stdout.write('\x1B[H' + output);
429
+ // Write each line at fixed position (no full screen redraw)
430
+ const lines = this.lines;
431
+ for (let i = 0; i < lines.length; i++) {
432
+ // Move to line i+1, column 1, then write line and clear to end
433
+ process.stdout.write(`\x1B[${i + 1};1H${lines[i]}\x1B[K`);
434
+ }
430
435
  this.lastOutput = output;
431
436
  }
432
437
  }
@@ -435,7 +440,8 @@ class AlgoUI {
435
440
  }
436
441
 
437
442
  cleanup() {
438
- process.stdout.write('\x1B[?1049l\x1B[?25h');
443
+ process.stdout.write('\x1B[?25h');
444
+ console.clear();
439
445
  }
440
446
  }
441
447