fix: Improve CLI progress display and prevent tree-sitter WASM memory crashes
Replaces fixed-width padding with terminal escape sequences for proper progress line clearing across different terminal widths. Adds periodic parser reset every 5000 parses per language to prevent WASM heap fragmentation that causes "memory access out of bounds" crashes in large repositories. Includes filename truncation to fit available terminal width.
This commit is contained in:
@@ -135,7 +135,7 @@ export class TextEmbedder {
|
||||
? (progress: { status: string; file?: string; progress?: number }) => {
|
||||
if (progress.status === 'progress' && progress.file && progress.progress) {
|
||||
const pct = Math.round(progress.progress);
|
||||
process.stdout.write(`\rDownloading ${progress.file}: ${pct}%`);
|
||||
process.stdout.write(`\rDownloading ${progress.file}: ${pct}%\x1b[K`);
|
||||
} else if (progress.status === 'done') {
|
||||
process.stdout.write('\n');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user