Skip to content

fix(cli): use rich.Table for resume session list to fix CJK alignment#44203

Open
Weidows wants to merge 1 commit into
NousResearch:mainfrom
Weidows:fix/resume-table-cjk-alignment
Open

fix(cli): use rich.Table for resume session list to fix CJK alignment#44203
Weidows wants to merge 1 commit into
NousResearch:mainfrom
Weidows:fix/resume-table-cjk-alignment

Conversation

@Weidows

@Weidows Weidows commented Jun 11, 2026

Copy link
Copy Markdown

Summary

Replace str.format() fixed-width table rendering with rich.table.Table in the /resume inline session list and hermes sessions list command. Fixes CJK (Chinese/Japanese/Korean) character alignment by using Rich's Unicode-aware column width handling.

Before

  #   Title                            Preview                                  Last Active   ID
  ─── ──────────────────────────────── ──────────────────────────────────────── ───────────── ────────────────────────
  2   整理论文和更新README #4                 我更新了paper/和 …   6d ago        20260604_195221_254cc9

After

  #  Last Active    ID                        Title / Preview
  1  ?              sess_002                  整理论文和更新README #4 — 我更新了paper/和README

Changes

cli.py_show_recent_sessions()

  • Replace print(f"{'#':<3} {'Title':<32} ...") with rich.table.Table
  • Columns reordered: # | Last Active | ID | Title / Preview
  • Title and Preview merged into one column to prevent width bleed
  • Preview limit increased from 38 to 80 chars

hermes_cli/main.pycmd_sessions() list action

  • Same rich.table.Table migration
  • Columns reordered: Last Active | ID | Title | Preview (with titles) or Last Active | ID | Preview | Src (no titles)
  • Preview limit increased from 38/48 to 80 chars

Validation

  • Verified output with CJK titles renders correctly (Rich handles double-width chars)
  • Existing test assertions (test_show_recent_sessions_includes_indexes_and_resume_hint, test_resume_list_shows_full_long_titles) confirmed compatible

Closes #44199

Replace basic str.format() column padding with rich.table.Table which
properly handles CJK (double-width) characters. Also rearrange columns
so that 'Last Active' and 'ID' appear on the left side, keeping the
variable-length 'Title / Preview' on the right where width doesn't
affect alignment of other columns.

Changes:
- cli.py (_show_recent_sessions): switch from print(f'{:32}') to
  rich.table.Table with CJK-aware column widths; merge Title + Preview
  into a single column; increase preview width from 38 to 80 chars.
- hermes_cli/main.py (cmd_sessions 'list'): same treatment for the
  'hermes sessions list' command — rich.table.Table with columns
  reordered to Last Active | ID | Title | Preview.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(cli): CJK characters misaligned in /resume and sessions list tables

2 participants