From 74e18f2b38464852818a0dc9e9dc8086c52432f8 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Sat, 5 Oct 2024 12:37:35 +0200 Subject: [PATCH] Rework terminal initialization --- src/App.svelte | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index ac8cf0a..82e360e 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -13,8 +13,7 @@ term.loadAddon(fitAddon); var linkAddon = new WebLinksAddon(); term.loadAddon(linkAddon); - - onMount(function() + function initTerminal() { const consoleDiv = document.getElementById("console"); term.open(consoleDiv); @@ -22,7 +21,8 @@ fitAddon.fit(); window.addEventListener("resize", function(ev){ fitAddon.fit(); }); term.focus(); - }); + } + onMount(initTerminal);