Skip to content

Commit c1d95bc

Browse files
committed
fix: simplify terminal auto-sizing by always using autoCols
1 parent e9d5ce7 commit c1d95bc

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/components/bottomPanel/tabs/terminal/LogsTerminal.vue

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import type { Ref } from 'vue'
1919
import { onMounted, onUnmounted, ref } from 'vue'
2020
2121
import type { useTerminal } from '@/composables/bottomPanelTabs/useTerminal'
22-
import type { LogEntry, LogsWsMessage, TerminalSize } from '@/schemas/apiSchema'
22+
import type { LogEntry, LogsWsMessage } from '@/schemas/apiSchema'
2323
import { api } from '@/scripts/api'
2424
import { useExecutionStore } from '@/stores/executionStore'
2525
@@ -32,27 +32,22 @@ const terminalCreated = (
3232
{ terminal, useAutoSize }: ReturnType<typeof useTerminal>,
3333
root: Ref<HTMLElement | undefined>
3434
) => {
35-
// `autoCols` is false because we don't want the progress bar in the terminal
36-
// to render incorrectly as the progress bar is rendered based on the
37-
// server's terminal size.
38-
// Apply a min cols of 80 for colab environments
35+
// Auto-size terminal to fill container width.
36+
// minCols: 80 ensures minimum width for colab environments.
3937
// See https://github.com/comfyanonymous/ComfyUI/issues/6396
40-
useAutoSize({ root, autoRows: true, autoCols: false, minCols: 80 })
38+
useAutoSize({ root, autoRows: true, autoCols: true, minCols: 80 })
4139
42-
const update = (entries: Array<LogEntry>, size?: TerminalSize) => {
43-
if (size) {
44-
terminal.resize(size.cols, terminal.rows)
45-
}
40+
const update = (entries: Array<LogEntry>) => {
4641
terminal.write(entries.map((e) => e.m).join(''))
4742
}
4843
4944
const logReceived = (e: CustomEvent<LogsWsMessage>) => {
50-
update(e.detail.entries, e.detail.size)
45+
update(e.detail.entries)
5146
}
5247
5348
const loadLogEntries = async () => {
5449
const logs = await api.getRawLogs()
55-
update(logs.entries, logs.size)
50+
update(logs.entries)
5651
}
5752
5853
const watchLogs = async () => {

0 commit comments

Comments
 (0)