From 4195b29bdb8df2da86a9d0a82037dead2bdabe97 Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Wed, 3 Dec 2025 22:18:27 -0500 Subject: [PATCH] fix: should allow autoCols=true when server doesn't provide size (#7132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary set autoCols = true by default for Logs Terminal ## Changes Previously, the logs terminal had autoCols: false to preserve server-side progress bar rendering, However, this caused large black empty areas when the server terminal was narrower than the UI panel, Many server environments don't provide terminal size at all, making this tradeoff not worthwhile. The original implementation set autoCols: false because the server renders progress bars based on its own terminal width. If the frontend used a different column count, progress bars would display incorrectly (e.g., wrapped or truncated). However, this created a poor user experience: 1. The terminal only filled a portion of the panel width (often 80 columns) 2. The remaining space appeared as a large black empty area 3. Many backend environments don't provide size data at all, making the fixed-width approach pointless fix https://github.com/Comfy-Org/ComfyUI_frontend/issues/7117 ## Screenshots (if applicable) before https://github.com/user-attachments/assets/e38af410-9cf1-4175-8acc-39d11a5b73ce after https://github.com/user-attachments/assets/3d180318-609f-44c5-aac5-230f9e4ef596 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7132-fix-should-allow-autoCols-true-when-server-doesn-t-provide-size-2be6d73d365081e7bf3bf5988bdba39a) by [Unito](https://www.unito.io) --- .../tabs/terminal/LogsTerminal.vue | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/bottomPanel/tabs/terminal/LogsTerminal.vue b/src/components/bottomPanel/tabs/terminal/LogsTerminal.vue index 65e84da3164..98cdb450e5c 100644 --- a/src/components/bottomPanel/tabs/terminal/LogsTerminal.vue +++ b/src/components/bottomPanel/tabs/terminal/LogsTerminal.vue @@ -19,7 +19,7 @@ import type { Ref } from 'vue' import { onMounted, onUnmounted, ref } from 'vue' import type { useTerminal } from '@/composables/bottomPanelTabs/useTerminal' -import type { LogEntry, LogsWsMessage, TerminalSize } from '@/schemas/apiSchema' +import type { LogEntry, LogsWsMessage } from '@/schemas/apiSchema' import { api } from '@/scripts/api' import { useExecutionStore } from '@/stores/executionStore' @@ -32,27 +32,22 @@ const terminalCreated = ( { terminal, useAutoSize }: ReturnType, root: Ref ) => { - // `autoCols` is false because we don't want the progress bar in the terminal - // to render incorrectly as the progress bar is rendered based on the - // server's terminal size. - // Apply a min cols of 80 for colab environments + // Auto-size terminal to fill container width. + // minCols: 80 ensures minimum width for colab environments. // See https://github.com/comfyanonymous/ComfyUI/issues/6396 - useAutoSize({ root, autoRows: true, autoCols: false, minCols: 80 }) + useAutoSize({ root, autoRows: true, autoCols: true, minCols: 80 }) - const update = (entries: Array, size?: TerminalSize) => { - if (size) { - terminal.resize(size.cols, terminal.rows) - } + const update = (entries: Array) => { terminal.write(entries.map((e) => e.m).join('')) } const logReceived = (e: CustomEvent) => { - update(e.detail.entries, e.detail.size) + update(e.detail.entries) } const loadLogEntries = async () => { const logs = await api.getRawLogs() - update(logs.entries, logs.size) + update(logs.entries) } const watchLogs = async () => {