MCPcopy Index your code
hub / github.com/codeaashu/claude-code / truncateCommand

Function truncateCommand

src/tools/TaskStopTool/UI.tsx:12–22  ·  view source on GitHub ↗
(command: string)

Source from the content-addressed store, hash-verified

10const MAX_COMMAND_DISPLAY_LINES = 2;
11const MAX_COMMAND_DISPLAY_CHARS = 160;
12function truncateCommand(command: string): string {
13 const lines = command.split('\n');
14 let truncated = command;
15 if (lines.length > MAX_COMMAND_DISPLAY_LINES) {
16 truncated = lines.slice(0, MAX_COMMAND_DISPLAY_LINES).join('\n');
17 }
18 if (stringWidth(truncated) > MAX_COMMAND_DISPLAY_CHARS) {
19 truncated = truncateToWidthNoEllipsis(truncated, MAX_COMMAND_DISPLAY_CHARS);
20 }
21 return truncated.trim();
22}
23export function renderToolResultMessage(output: Output, _progressMessagesForMessage: unknown[], {
24 verbose
25}: {

Callers 1

renderToolResultMessageFunction · 0.85

Calls 1

Tested by

no test coverage detected