Repository navigation
Live monitoring dashboard box layout misalignment in various terminal widths #172
Description
Activity
I tested and found
- it doesn't work with some fonts.
- in my environment, wezterm causes a little layout mismatch
- ghostty is perfect
Would appreciate any insights or suggestions on how to properly handle terminal box alignment across different environments and terminal widths.
Is it AI generated? we don't know it.
Ghostty displays correctly, but zellij seems to have layout issues. tmux works fine.
In my environment (with any Font)
- OK:
- Ghostty
- iTerm2
- Warp
- (terminal multiplexer) tmux
- NG:
- Terminal.app
- Wezterm
- (terminal multiplexer) zellij
Is it AI generated? We don't know.
Sorry. I had the AI create this issue.
Reacted by ryoppippi- OK:
Thanks for your investigation
Hmm yeah we need to find howThe problem seems to be whether the emoji next to “SESSION” and “Models” are full-width or half-width.
NG (half-width emoji, Zellij over Ghostty)

For comparison, I have highlighted one half-width bit under the clock emoji to the left of SESSION.
This can be seen from the fact that the beginning of “SESSION” and “USAGE” may or may not be aligned.
Forcing the cursor to skip to a position 2 bytes after the emoji is drawn should solve this problem.
If you don't mind, please assign me to this Issue and I will implement it and send out a PR!
(I am just having trouble with this issue myself)Thank you @AsPulse ! Go ahead!!!!
Reacted by あすぱるI had a free hand and tried to get to it, but the emoji width issue that was the biggest problem with this issue seems to have been resolved in the latest main branch.
I will try to resolve the other issues that are causing the display to be corrupted.Sorry for the delay in responding......!!!
It was still occurring in some environments. I will continue to work on a fix.Reacted by istisikithanks!! if you are fine close this issue
Thanks for the merge, but this issue is still not completely resolved.
It may take a little more time to determine the cause, but I will eventually issue another PR,
so I would appreciate it if you could leave the issue open.

When using the ccusage blocks --live command to display the real-time token usage monitoring dashboard, the box borders become misaligned in certain terminal widths. The right border (│) appears to be offset or
"jumps" to incorrect positions, breaking the visual layout of the dashboard.
Steps to Reproduce
Expected Behavior
The dashboard should display a perfectly aligned box with all borders (┌─┐│└┘) forming a proper rectangle, regardless of the terminal width. All lines should have consistent width and the right border should align
vertically.
Actual Behavior
The right border (│) characters are not vertically aligned. In some cases:
Screenshots

Here are examples of the misalignment issue:
Technical Details
Environment:
Root Cause Analysis:
The issue appears to stem from inconsistent width calculations across different parts of the rendering logic:
Attempted Solutions
Several approaches were tried to fix this issue:
However, these solutions haven't fully resolved the alignment issues across all terminal widths and content combinations.
Additional Context
The issue is particularly noticeable when:
This is a visual/cosmetic issue that doesn't affect the functionality of the tool, but it does impact the user experience and professional appearance of the live monitoring feature.
Possible Solution Directions
Would appreciate any insights or suggestions on how to properly handle terminal box alignment across different environments and terminal widths.