Skip to content

feat(tuios): sidebarにAI使用量を表示し、prefix u・C-uをcopy mode入りにする - #445

Merged
shonenm merged 2 commits into
mainfrom
feat/tuios-usage-copy
Oct 19, 2026
Merged

shonenm merged 2 commits into
mainfrom
feat/tuios-usage-copy

Conversation

@shonenm

@shonenm shonenm commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Summary

tmux の sidebar にあった AI 使用量(残り)を tuios の sidebar に出す。prefix u / prefix C-u を tmux と同じく copy mode の入口にする。

Changes

  • tui usage を追加。ai-usage(claude / codex / gemini / cursor / grok)を並列に呼び、tmux-agent-sidebar.sh と同じ書式で描く。リミット消化ペースの色も同じ判定(sb_pace_color を移植)。
  • sidebar に custom section usage を追加(sessions,custom,agents、30秒ごとに更新)。session 一覧は標準の sessions 欄だけで、重複はしない。
  • prefix u / prefix C-u を prefix_selection(copy mode)に変更。tmux は copy mode に入ると同時に半ページ上へ移動するが、TUIOS 0.10.1 は1つのキーに2つの操作を割り当てられず、copy mode へ外からキーも送れない。そのため、続けて押す Ctrl+u(copy mode 内の半ページ上)で移動する。scrollback ブラウザーのキー割り当ては外した。

Test plan

  • python3 scripts/test-tui.py(41件。usage の書式とペース色、早期・使い切り・未知の label)
  • ペース色を tmux-agent-sidebar.sh の sb_pace_color と8パターンで突き合わせ、すべて一致
  • 実際の ai-usage で tui usage が約1.5秒で終わる(custom section の3秒制限内)
  • 隔離した daemon で、sidebar に usage 欄が出ること、prefix u / prefix C-u で copy mode に入り、続く Ctrl+u で半ページずつ上がることを確認

- tui usageでai-usageを並列に呼び、tmux sidebarと同じ書式・ペース色でusage欄に描く
- prefix u / C-uをtmuxと同じくcopy modeへの入口にする。半ページ上への移動は続くC-uで行う
@shonenm
shonenm merged commit 407fab6 into main Oct 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant