Skip to content

fix(cli): prevent status bar wrapping into duplicate rows#3883

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
kshitijk4poor:fix/cli-single-line-status-bar
Mar 30, 2026
Merged

fix(cli): prevent status bar wrapping into duplicate rows#3883
teknium1 merged 1 commit intoNousResearch:mainfrom
kshitijk4poor:fix/cli-single-line-status-bar

Conversation

@kshitijk4poor
Copy link
Copy Markdown
Contributor

@kshitijk4poor kshitijk4poor commented Mar 30, 2026

Problem

The interactive CLI status bar can render as multiple visible rows over longer sessions even though it is intended to stay on a single line.

This shows up as repeated model/context rows accumulating at the bottom of the terminal when the rendered status content is just wide enough to wrap.

Root Cause

The status bar logic was treating Python string length as a safe proxy for rendered terminal width.

That is not always true for prompt_toolkit-rendered terminal output. A fragment set that looks short enough by len() can still overflow the actual terminal cell width, wrap onto a second row, and leave behind duplicate-looking status lines over time.

Fix

  • measure status bar width using prompt_toolkit display cell widths instead of raw string length
  • trim status bar text to the available rendered width before returning it
  • add a final overflow guard in _get_status_bar_fragments() that collapses to a single trimmed fragment when needed
  • update the status bar width test to validate rendered display width instead of len()

Testing

  • python -m pytest tests/test_cli_status_bar.py -q
  • 13 passed
- measure status bar display width using prompt_toolkit cell widths
- trim rendered status text when fragments would overflow
- add a final single-fragment fallback to prevent wrapping
- update width assertions to validate display cells instead of len()
@teknium1 teknium1 merged commit c288bbf into NousResearch:main Mar 30, 2026
2 of 3 checks passed
itsXactlY pushed a commit to itsXactlY/hermes-agent that referenced this pull request Mar 30, 2026
…ch#3883)

- measure status bar display width using prompt_toolkit cell widths
- trim rendered status text when fragments would overflow
- add a final single-fragment fallback to prevent wrapping
- update width assertions to validate display cells instead of len()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants