Skip to content

Feature: configurable tool name truncation and wrap instead of hide on narrow terminals #544

@liao666brant

Description

@liao666brant

Problem

When MCP tool names are long (e.g. mcp__plugin_context-mode_context-mode__ctx_batch_execute), the tools line takes up excessive horizontal space. On narrower terminals, this causes important information to be truncated or hidden entirely.

Example of the current behavior on a narrow terminal:

✓ Read ×4 | ✓ Bash ×2 | ✓ ToolSearch ×1 | ✓ mcp__plugin_context-mode_context-mode__ctx_batch_execute ×1

The long MCP name pushes the line far beyond typical terminal widths.

Proposed Solution

Add two new config options under display:

toolNameMaxLength (number, default: 0 = no limit)

Maximum display length for tool names. When exceeded, the name is truncated intelligently:

  • For MCP-style names (mcp__xxx__tool_name), keep only the last segment (e.g. ctx_batch_execute)
  • For other names, truncate with suffix

toolsMaxVisible (number, default: 4, 0 = unlimited)

Maximum number of completed tool groups to display. Setting to 0 shows all tools, relying on the existing line-wrap mechanism to handle overflow.

Expected Behavior

With config:

{
  "display": {
    "showTools": true,
    "toolNameMaxLength": 20,
    "toolsMaxVisible": 0
  }
}
  • mcp__plugin_context-mode_context-mode__ctx_batch_executectx_batch_execute
  • All completed tools are shown (not capped at 4)
  • When terminal width is insufficient, tools wrap to the next line via the existing wrapLineToWidth mechanism instead of being hidden

Context

The existing wrapLineToWidth in render/index.ts already splits lines by | separators and wraps them. The missing pieces are:

  1. No way to shorten long tool names before rendering
  2. Hardcoded .slice(0, 4) limit on completed tools prevents showing all tools even when wrapping is available

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions