From 3c48d498123bdfb07bd9d91bdf8c88d629ad4b70 Mon Sep 17 00:00:00 2001 From: Bartok Moltbot Date: Fri, 27 Feb 2026 03:23:06 -0500 Subject: [PATCH] fix(cli): Correct /tools display alignment and truncation Fixes #37 Issues fixed: 1. Header was off by 1 space (25+22+30=77 vs 78-char box interior) Changed to 28+22+28=78 for proper centering 2. Tool descriptions could overflow the 80-char terminal width Added truncation to 48 chars with '...' suffix The display now renders correctly on standard 80-column terminals. --- cli.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index 0739a0c20639..57be6dbd6aac 100755 --- a/cli.py +++ b/cli.py @@ -1096,10 +1096,10 @@ def show_tools(self): print("(;_;) No tools available") return - # Header + # Header - centered in 78-char box (28 + 22 + 28 = 78) print() print("+" + "-" * 78 + "+") - print("|" + " " * 25 + "(^_^)/ Available Tools" + " " * 30 + "|") + print("|" + " " * 28 + "(^_^)/ Available Tools" + " " * 28 + "|") print("+" + "-" * 78 + "+") print() @@ -1115,6 +1115,10 @@ def show_tools(self): desc = desc.split("\n")[0] if ". " in desc: desc = desc[:desc.index(". ") + 1] + # Truncate description to fit 80-char terminal (6 indent + 20 name + 3 sep = 29, leaving ~48) + max_desc_len = 48 + if len(desc) > max_desc_len: + desc = desc[:max_desc_len - 3] + "..." toolsets[toolset].append((name, desc)) # Display by toolset