Przeglądaj źródła

fix(tui): reduce markdown width to account for prefix and padding

Tables were overflowing the visible area because the width calculation
didn't account for the 2-char prefix (◆) in addition to paddingX.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fanghanjun 7 miesięcy temu
rodzic
commit
f617ca270b
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      packages/cli/src/tui/markdown.ts

+ 2 - 1
packages/cli/src/tui/markdown.ts

@@ -4,7 +4,8 @@ import { isAppleTerminal } from "./theme.js";
 
 
 const marked = new Marked();
 const marked = new Marked();
 marked.use(markedTerminal({
 marked.use(markedTerminal({
-  width: Math.min(process.stdout.columns ?? 80, 100) - 8,
+  // Terminal width minus paddingX(2*2) + prefix(2) + margin(2) = 8, plus extra 2 for safety
+  width: Math.min(process.stdout.columns ?? 80, 100) - 10,
   reflowText: true,
   reflowText: true,
   showSectionPrefix: false,
   showSectionPrefix: false,
   tab: 2,
   tab: 2,