claudefix 2.6.0 → 2.6.1

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/bin/claude-fixed.js +14 -39
  2. package/package.json +1 -1
@@ -805,15 +805,11 @@ if (!usePTY) {
805
805
  const cols = process.stdout.columns || 80;
806
806
 
807
807
  if (sshMode || !showFooter) {
808
- // SSH mode or no footer: NO scroll region manipulation
809
808
  ptyProcess.resize(cols, rows);
810
809
  } else {
811
- // Local mode with footer: reserve bottom row(s) for footer
812
- // FIX: Handle edge case where terminal is too small
810
+ // Reserve bottom row(s) for footer via scroll region + PTY resize
813
811
  const contentRows = Math.max(1, rows - footerRows);
814
812
 
815
- // FIX: Reset scroll region first, then set new one to avoid clipping
816
- // This prevents content from being cut off during dynamic resize
817
813
  process.stdout.write(
818
814
  '\x1b[r' + // Reset scroll region to full terminal
819
815
  '\x1b7' + // Save cursor position
@@ -821,7 +817,6 @@ if (!usePTY) {
821
817
  '\x1b8' // Restore cursor position
822
818
  );
823
819
 
824
- // Resize PTY to content area (excludes footer row(s))
825
820
  ptyProcess.resize(cols, contentRows);
826
821
  }
827
822
  }
@@ -866,22 +861,16 @@ if (!usePTY) {
866
861
  );
867
862
  }
868
863
 
869
- // FIX (Linux only): Enter alternate screen buffer to prevent ghost frames.
870
- // Ink renders inline (no alternate screen) content stacks/triplicates on re-render.
871
- // By entering alternate screen ourselves, Ink's output goes to a clean buffer.
872
- // On exit, we leave alternate screen to restore the original terminal content.
873
- if (!isMac && !sshMode) {
874
- process.stdout.write('\x1b[?1049h\x1b[H\x1b[J'); // Enter alternate screen + clear
875
- }
864
+ // FIX (Linux only): Clear screen once at startup to prevent ghost frames.
865
+ // Ink renders inline (no alternate screen) and re-renders during startup cause
866
+ // content to stack/triplicate. A single clear before first output fixes this.
867
+ // NOTE: Do NOT use alternate screen (\x1b[?1049h) it makes Ink switch to
868
+ // full-screen mode where it sends \x1b[H\x1b[J which erases the footer.
869
+ let startupCleared = false;
876
870
 
877
871
  // Initial setup
878
872
  setupScrollRegion();
879
- if (!sshMode && showFooter) {
880
- drawFooter();
881
- // Re-draw footer after Ink's initial setup (Ink may overwrite during startup)
882
- setTimeout(drawFooter, 500);
883
- setTimeout(drawFooter, 1500);
884
- }
873
+ if (!sshMode && showFooter) drawFooter();
885
874
 
886
875
  // Footer refresh - debounced, only redraws AFTER PTY output settles
887
876
  // No independent timer - footer only redraws in response to PTY activity
@@ -941,7 +930,7 @@ if (!usePTY) {
941
930
  !isAppleTerminal;
942
931
  if (shouldStrip) output = stripColors(output);
943
932
 
944
- // FIX: Intercept scroll region resets from Ink/Claude output.
933
+ // Intercept scroll region resets from Ink — replace with our constrained region
945
934
  if (showFooter && !sshMode) {
946
935
  const cr = contentRows();
947
936
  output = output.replace(/\x1b\[r/g, `\x1b[1;${cr}r`);
@@ -963,22 +952,14 @@ if (!usePTY) {
963
952
  // - Full repaint: large buffer (most of the screen rewritten)
964
953
  // - Partial update (prompt only): small buffer
965
954
  // Threshold: at least half the screen worth of content (contentRows * 30 bytes)
966
- // FIX: Strip Ink's alternate screen sequences we manage alternate screen
967
- // ourselves. If Ink enters/exits alternate screen, it disrupts our scroll
968
- // region and footer. Remove these so our alternate screen stays in control.
969
- if (!isMac && !sshMode) {
970
- output = output.replace(/\x1b\[\?1049[hl]/g, '');
971
- // Also strip smcup/rmcup variants
972
- output = output.replace(/\x1b\[\?47[hl]/g, '');
955
+ // FIX (Linux only): Clear screen once before first output to prevent
956
+ // startup ghost frames (triplicated content from Ink's initial renders)
957
+ if (!isMac && !startupCleared) {
958
+ startupCleared = true;
959
+ output = '\x1b[2J\x1b[3J\x1b[H' + output;
973
960
  }
974
961
 
975
962
  process.stdout.write(output);
976
- // Re-assert scroll region after each flush (Ink may have sent sequences that
977
- // override it, even after our replacements)
978
- if (showFooter && !sshMode) {
979
- const cr = contentRows();
980
- process.stdout.write(`\x1b7\x1b[1;${cr}r\x1b8`);
981
- }
982
963
  if (showFooter) scheduleFooterDraw();
983
964
  }
984
965
 
@@ -1059,9 +1040,6 @@ if (!usePTY) {
1059
1040
  if (flushTimer) { clearTimeout(flushTimer); flushTimer = null; }
1060
1041
  if (outputBuffer) { process.stdout.write(outputBuffer); outputBuffer = ''; }
1061
1042
  // Clean exit: leave alternate screen, reset scroll region
1062
- if (!isMac && !sshMode) {
1063
- process.stdout.write('\x1b[?1049l'); // Exit alternate screen buffer
1064
- }
1065
1043
  if (!sshMode && showFooter) {
1066
1044
  process.stdout.write(
1067
1045
  '\x1b[r' + // Reset scroll region to full terminal
@@ -1121,9 +1099,6 @@ if (!usePTY) {
1121
1099
  if (pendingDraw) clearTimeout(pendingDraw);
1122
1100
  if (flushTimer) { clearTimeout(flushTimer); flushTimer = null; }
1123
1101
  if (outputBuffer) { process.stdout.write(outputBuffer); outputBuffer = ''; }
1124
- if (!isMac && !sshMode) {
1125
- process.stdout.write('\x1b[?1049l'); // Exit alternate screen buffer
1126
- }
1127
1102
  if (!sshMode && showFooter) {
1128
1103
  process.stdout.write(
1129
1104
  '\x1b[r' + // Reset scroll region
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claudefix",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Fixes screen glitching, blocky colors, AND MEMORY LEAKS in Claude Code CLI on Linux and macOS. All features optional via env vars. Shows config options on install. Developed by Hardwick Software Services @ https://justcalljon.pro",
5
5
  "main": "index.cjs",
6
6
  "bin": {