From d5b8a555d9ce5e446f7534b406705460aa1dc58c Mon Sep 17 00:00:00 2001 From: pythongosssss <125205205+pythongosssss@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:09:54 +0000 Subject: [PATCH] [Electron] xterm startup logs (#1620) * Add live terminal output * Fix scrolling * Refactor loading * Fallback to polling if endpoint fails * Comment * Move clientId to executionStore Refactor types * Remove polling * wip terminal command input * Refactor to use node-pty * Hide tabs if not electron * Lint fix * ts fix * Refactor tab components * Use xterm for startup logs * Nicer logs display * Fix not setting xterm + mark terminal as raw --- src/hooks/bottomPanelTabs/useTerminal.ts | 10 +++--- src/views/ServerStartView.vue | 40 ++++++++++++++++-------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/hooks/bottomPanelTabs/useTerminal.ts b/src/hooks/bottomPanelTabs/useTerminal.ts index e7a8742a6..4885119f5 100644 --- a/src/hooks/bottomPanelTabs/useTerminal.ts +++ b/src/hooks/bottomPanelTabs/useTerminal.ts @@ -1,14 +1,16 @@ import { FitAddon } from '@xterm/addon-fit' import { Terminal } from '@xterm/xterm' import { debounce } from 'lodash' -import { onMounted, onUnmounted, Ref } from 'vue' +import { markRaw, onMounted, onUnmounted, Ref } from 'vue' import '@xterm/xterm/css/xterm.css' export function useTerminal(element: Ref) { const fitAddon = new FitAddon() - const terminal = new Terminal({ - convertEol: true - }) + const terminal = markRaw( + new Terminal({ + convertEol: true + }) + ) terminal.loadAddon(fitAddon) onMounted(async () => { diff --git a/src/views/ServerStartView.vue b/src/views/ServerStartView.vue index 4cfba95de..db0543507 100644 --- a/src/views/ServerStartView.vue +++ b/src/views/ServerStartView.vue @@ -3,42 +3,56 @@ class="font-sans flex flex-col justify-center items-center h-screen m-0 text-neutral-300 bg-neutral-900 dark-theme pointer-events-auto" >

{{ ProgressMessages[status] }}

- + + +