summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/App.tsx
diff options
context:
space:
mode:
authorSandy Tao <[email protected]>2025-06-23 14:45:15 -0700
committerGitHub <[email protected]>2025-06-23 21:45:15 +0000
commitfcb8be2fb9f6252435d987328f795ae2ff4b04c8 (patch)
tree268e5ff63c013de6aa5903e03be0047435c39351 /packages/cli/src/ui/App.tsx
parent1faf53a3af57ea977b6d294dbe59adca26267203 (diff)
Refine refresh static logic (#1349)
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
-rw-r--r--packages/cli/src/ui/App.tsx11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 7d2e62dd..c25d74e2 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -239,7 +239,6 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
const pendingHistoryItems = [...pendingSlashCommandHistoryItems];
const { rows: terminalHeight, columns: terminalWidth } = useTerminalSize();
- const lastTerminalWidth = useRef(terminalWidth);
const isInitialMount = useRef(true);
const { stdin, setRawMode } = useStdin();
const isValidPath = useCallback((filePath: string): boolean => {
@@ -319,11 +318,9 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
if (key.ctrl && input === 'o') {
setShowErrorDetails((prev) => !prev);
- refreshStatic();
} else if (key.ctrl && input === 't') {
const newValue = !showToolDescriptions;
setShowToolDescriptions(newValue);
- refreshStatic();
const mcpServers = config.getMcpServers();
if (Object.keys(mcpServers || {}).length > 0) {
@@ -475,16 +472,14 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
// debounce so it doesn't fire up too often during resize
const handler = setTimeout(() => {
- if (terminalWidth < lastTerminalWidth.current) {
- setStaticNeedsRefresh(true);
- }
- lastTerminalWidth.current = terminalWidth;
+ setStaticNeedsRefresh(false);
+ refreshStatic();
}, 300);
return () => {
clearTimeout(handler);
};
- }, [terminalWidth]);
+ }, [terminalWidth, terminalHeight, refreshStatic]);
useEffect(() => {
if (!pendingHistoryItems.length) {