From db6cb902152bcb341377086a6ef6f1979c099bb2 Mon Sep 17 00:00:00 2001 From: Isaac Johnson Date: Sun, 31 May 2026 22:01:08 -0500 Subject: [PATCH] fix repo display on list pass --- test-header.ts | 10 ++++++++++ test-output.txt | 46 ++++++++++++++++++++++++++++++++++++++++++++++ test-wrap.ts | 6 ++++++ 3 files changed, 62 insertions(+) create mode 100644 test-header.ts create mode 100644 test-output.txt create mode 100644 test-wrap.ts diff --git a/test-header.ts b/test-header.ts new file mode 100644 index 0000000..5537f12 --- /dev/null +++ b/test-header.ts @@ -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); diff --git a/test-output.txt b/test-output.txt new file mode 100644 index 0000000..90dfdd6 --- /dev/null +++ b/test-output.txt @@ -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 \ No newline at end of file diff --git a/test-wrap.ts b/test-wrap.ts new file mode 100644 index 0000000..6637732 --- /dev/null +++ b/test-wrap.ts @@ -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));