hedgequantx 2.6.77 → 2.6.78

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.77",
3
+ "version": "2.6.78",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -141,7 +141,8 @@ class AlgoUI {
141
141
  this.spinnerFrame = 0;
142
142
  this.firstDraw = true;
143
143
  this.isDrawing = false;
144
- this.buffer = '';
144
+ this.lines = [];
145
+ this.lastOutput = '';
145
146
  }
146
147
 
147
148
  addLog(type, message) {
@@ -151,7 +152,7 @@ class AlgoUI {
151
152
  }
152
153
 
153
154
  _line(text) {
154
- this.buffer += text + '\x1B[K\n';
155
+ this.lines.push(text);
155
156
  }
156
157
 
157
158
  _drawHeader() {
@@ -379,25 +380,30 @@ class AlgoUI {
379
380
  if (this.isDrawing) return;
380
381
  this.isDrawing = true;
381
382
 
382
- this.buffer = '';
383
+ this.lines = [];
383
384
 
384
385
  if (this.firstDraw) {
385
- // Enter alternate screen, hide cursor, clear
386
- this.buffer += '\x1B[?1049h\x1B[?25l\x1B[2J';
386
+ // Enter alternate screen, hide cursor, clear once
387
+ process.stdout.write('\x1B[?1049h\x1B[?25l\x1B[2J');
387
388
  this.firstDraw = false;
388
389
  }
389
390
 
390
- // Move cursor to home position (no clear - reduces flicker)
391
- this.buffer += '\x1B[H';
392
391
  this._line('');
393
392
  this._drawHeader();
394
393
  this._drawStats(stats);
395
394
  this._drawLogs();
396
395
 
397
- // Write buffer in one shot, then flush
398
- process.stdout.write(this.buffer, () => {
399
- this.isDrawing = false;
400
- });
396
+ // Build output with fixed line positions
397
+ const output = this.lines.join('\n');
398
+
399
+ // Only write if content changed (reduces flicker significantly)
400
+ if (output !== this.lastOutput) {
401
+ // Move cursor to home, then write all lines
402
+ process.stdout.write('\x1B[H' + output);
403
+ this.lastOutput = output;
404
+ }
405
+
406
+ this.isDrawing = false;
401
407
  }
402
408
 
403
409
  cleanup() {