fix repo display on list pass

This commit is contained in:
Isaac Johnson 2026-05-31 22:01:08 -05:00
parent 6dc4c46b14
commit db6cb90215
3 changed files with 62 additions and 0 deletions

10
test-header.ts Normal file
View File

@ -0,0 +1,10 @@
import chalk from 'chalk';
import stripAnsi from 'strip-ansi';
const cols = 80;
const rightHeader = `repo: ${chalk.bold.cyan(`builderadmin/PublicProject`)} `;
const rightLen = stripAnsi(rightHeader).length;
const leftHeader = ` Forgejo Issue Explorer`;
const leftLen = stripAnsi(leftHeader).length;
let spacesCount = cols - leftLen - rightLen;
console.log(leftHeader + ' '.repeat(spacesCount) + rightHeader);

46
test-output.txt Normal file
View File

@ -0,0 +1,46 @@
Connecting to Gitea/Forgejo instance at https://forgejo.freshbrewed.science...
[?1049h[?25l ⠙ Forgejo Issue Explorer repo: builderadmin/PublicProject
┌──────────────────────────────────────────────────────────────────────────────┐
│ ID │ Type │ State │ Title │ Author │ Created │ Coms │
├──────────────────────────────────────────────────────────────────────────────┤
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ Fetching issues from server... │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├──────────────────────────────────────────────────────────────────────────────┤
│ Search: none ─ State: OPEN ─ Type: ALL ─ Sort: created (DESC) │
└──────────────────────────────────────────────────────────────────────────────┘
[↑/↓] Navigate [Enter] View [/] Search [S] Sort [F] State [T] Type [N/P] Page [R] Reload [O] Settings [Esc] Quit Forgejo Issue Explorer ─ P. 1/1 (2) repo: builderadmin/PublicProject
┌──────────────────────────────────────────────────────────────────────────────┐
│ ID │ Type │ State │ Title │ Author │ Created │ Coms │
├──────────────────────────────────────────────────────────────────────────────┤
│ #2 │ Issue│ OPEN │ Issue from Copilot │ testmcp │ 2025-11-18 │ 0 │
│ #1 │ Issue│ OPEN │ This is a Test Issue │ testmcp │ 2025-11-17 │ 0 │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
│ │
├──────────────────────────────────────────────────────────────────────────────┤
│ Search: none ─ State: OPEN ─ Type: ALL ─ Sort: created (DESC) │
└──────────────────────────────────────────────────────────────────────────────┘
[↑/↓] Navigate [Enter] View [/] Search [S] Sort [F] State [T] Type [N/P] Page [R] Reload [O] Settings [Esc] Quit

6
test-wrap.ts Normal file
View File

@ -0,0 +1,6 @@
const cols = process.stdout.columns || 80;
const rows = process.stdout.rows || 24;
process.stdout.write('\x1B[2J\x1B[H');
console.log('A'.repeat(cols));
console.log('B'.repeat(cols));
process.stdout.write('C'.repeat(cols - 1));