─── Terminal Box Helpers ────────────────────────────────────── Shared UI functions for rendering consistent boxed output across /mcp, /hooks, /cost, /channel, /worktree, etc.
()
| 13 | // across /mcp, /hooks, /cost, /channel, /worktree, etc. |
| 14 | |
| 15 | func uiTermWidth() int { |
| 16 | w, _, err := term.GetSize(int(os.Stdout.Fd())) //#nosec G115 -- value bounded by domain |
| 17 | if err != nil || w <= 0 { |
| 18 | return 80 |
| 19 | } |
| 20 | return w |
| 21 | } |
| 22 | |
| 23 | // uiBox renders a box header: ╭── icon TITLE |
| 24 | func uiBox(icon, title, color string) string { |