Sfoglia il codice sorgente

fix(ui): keep the viewer's printed copy readable on a legacy Windows console

The 'no index' guidance carried a literal em dash and the banner an ellipsis.
A Windows console on an OEM codepage decodes raw UTF-8 as mojibake (#168),
which is exactly what getGlyphs() exists to avoid — seen on the VM. Guidance
now takes its dash from the glyph set; the banner uses a plain '...'.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Colby McHenry 1 settimana fa
parent
commit
41a90c6ba4
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      src/bin/codegraph.ts

+ 4 - 2
src/bin/codegraph.ts

@@ -1839,7 +1839,9 @@ program
 function printNoIndexGuidance(projectPath: string): void {
 function printNoIndexGuidance(projectPath: string): void {
   error(`No CodeGraph index found for ${projectPath}`);
   error(`No CodeGraph index found for ${projectPath}`);
   console.error('');
   console.error('');
-  console.error('  The viewer reads an index that already exists — it never creates one.');
+  // getGlyphs() (not a literal em dash): a legacy Windows console decodes raw
+  // UTF-8 with its OEM codepage and renders one as mojibake (#168).
+  console.error(`  The viewer reads an index that already exists ${getGlyphs().dash} it never creates one.`);
   console.error('  To index this project:');
   console.error('  To index this project:');
   console.error('');
   console.error('');
   console.error(`    ${chalk.cyan('codegraph init')}`);
   console.error(`    ${chalk.cyan('codegraph init')}`);
@@ -1944,7 +1946,7 @@ ${BROWSER_ENV}=none to never open one.
     const opened = options.open === false ? false : openBrowser(handle.url);
     const opened = options.open === false ? false : openBrowser(handle.url);
     console.log(
     console.log(
       opened
       opened
-        ? chalk.dim('  Opening your browser press Ctrl+C to stop.')
+        ? chalk.dim('  Opening your browser... press Ctrl+C to stop.')
         : chalk.dim('  Open that URL in a browser. Press Ctrl+C to stop.')
         : chalk.dim('  Open that URL in a browser. Press Ctrl+C to stop.')
     );
     );
     console.log('');
     console.log('');