diff options
| author | Xe Iaso <me@xeiaso.net> | 2023-04-29 13:26:09 -0400 |
|---|---|---|
| committer | Xe Iaso <me@xeiaso.net> | 2023-04-29 13:26:09 -0400 |
| commit | 042d4fa9523edb9b0613902d67452df10078c836 (patch) | |
| tree | 377a856295cdefa79ff5f807b1370c975e899e7a /src/frontend/components/WASITerm.tsx | |
| parent | 9d9614ad8a4a1d00f7df1b0e37ec32d324151335 (diff) | |
| download | xesite-yarn.tar.xz xesite-yarn.zip | |
fucking horrible typescript garbageyarn
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'src/frontend/components/WASITerm.tsx')
| -rw-r--r-- | src/frontend/components/WASITerm.tsx | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/frontend/components/WASITerm.tsx b/src/frontend/components/WASITerm.tsx index 5f7e7f9..644f293 100644 --- a/src/frontend/components/WASITerm.tsx +++ b/src/frontend/components/WASITerm.tsx @@ -1,9 +1,6 @@ -// @jsxImportSource xeact -// @jsxRuntime automatic - -import { t, x } from "xeact"; -import Terminal from "@xterm"; -import * as fitAdd from "@xterm/addon-fit"; +import { t, x, h } from "@xeserv/xeact"; +import { Terminal } from "xterm"; +import { FitAddon } from 'xterm-addon-fit'; import { Fd, File, PreopenDirectory, WASI } from "@bjorn3/browser_wasi_shim"; class XtermStdio extends Fd { @@ -41,16 +38,17 @@ export interface WASITermProps { } export default function WASITerm({ href, env, args }: WASITermProps) { - const root = <div style="max-width:80ch;max-height:20ch"></div>; + const root = h("div", {style:"max-width:80ch;max-height:20ch"}, []); const term = new Terminal({ convertEol: true, fontFamily: "Iosevka Curly Iaso", }); - const fit = new fitAdd.default(); - term.loadAddon(fit); - fit.fit(); + const fitAddon = new FitAddon(); + term.loadAddon(fitAddon); + term.open(root); + fitAddon.fit(); return ( <div> |
