fix: resize input (#6)

This commit is contained in:
Charles Packer
2025-10-25 13:48:23 -07:00
committed by GitHub
parent da2c50cbeb
commit 5bb31db14f
10 changed files with 121 additions and 51 deletions

View File

@@ -2,6 +2,7 @@ import { Box, Text } from "ink";
import { memo, useEffect, useState } from "react";
import { clipToolReturn } from "../../tools/manager.js";
import { formatArgsDisplay } from "../helpers/formatArgsDisplay.js";
import { useTerminalWidth } from "../hooks/useTerminalWidth";
import { colors } from "./colors.js";
import { MarkdownDisplay } from "./MarkdownDisplay.js";
import { TodoRenderer } from "./TodoRenderer.js";
@@ -41,12 +42,7 @@ const BlinkDot: React.FC<{ color?: string }> = ({
* - Result shown with ⎿ prefix underneath
*/
export const ToolCallMessage = memo(({ line }: { line: ToolCallLine }) => {
const columns =
typeof process !== "undefined" &&
process.stdout &&
"columns" in process.stdout
? ((process.stdout as { columns?: number }).columns ?? 80)
: 80;
const columns = useTerminalWidth();
// Parse and format the tool call
const rawName = line.name ?? "?";