From 623954e582c84e734473429124d861aa3010c876 Mon Sep 17 00:00:00 2001 From: Comfy Org PR Bot Date: Tue, 9 Dec 2025 09:15:08 +0900 Subject: [PATCH] [backport core/1.33] fix: should allow autoCols=true when server doesn't provide size (#7249) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Backport of #7132 to `core/1.33` Automatically created by backport workflow. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7249-backport-core-1-33-fix-should-allow-autoCols-true-when-server-doesn-t-provide-size-2c36d73d365081679b89fdf5ea4083d2) by [Unito](https://www.unito.io) Co-authored-by: Terry Jia --- .../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 65e84da316..98cdb450e5 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 () => {