Skip to content

Commit 2f1ffe6

Browse files
committed
fix(core): update terminal size on panel resizing
1 parent 1584b74 commit 2f1ffe6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

packages/core/src/client/webcomponents/components/ViewBuiltinTerminalPanel.vue

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { TerminalState } from '../state/terminals'
55
import { useEventListener } from '@vueuse/core'
66
import { FitAddon } from '@xterm/addon-fit'
77
import { Terminal } from '@xterm/xterm'
8-
import { markRaw, nextTick, onMounted, onUnmounted, ref } from 'vue'
8+
import { markRaw, nextTick, onMounted, onUnmounted, ref, watch } from 'vue'
99
1010
const props = defineProps<{
1111
context: DocksContext
@@ -26,6 +26,15 @@ onMounted(async () => {
2626
term.open(container.value!)
2727
fitAddon.fit()
2828
29+
watch([
30+
() => props.context.panel.store.width,
31+
() => props.context.panel.store.height,
32+
], () => {
33+
nextTick(() => {
34+
fitAddon.fit()
35+
})
36+
})
37+
2938
useEventListener(window, 'resize', () => {
3039
fitAddon.fit()
3140
})

0 commit comments

Comments
 (0)