mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-20 07:08:40 +03:00
35 lines
658 B
HTML
35 lines
658 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>WASM Example</title>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
const importObject = {
|
|
module: {},
|
|
env: {
|
|
// memory: new WebAssembly.Memory({ initial: 256 }),
|
|
}
|
|
};
|
|
|
|
fetch('ghostty-term.wasm').then(response =>
|
|
response.arrayBuffer()
|
|
).then(bytes =>
|
|
WebAssembly.instantiate(bytes, importObject)
|
|
).then(results => {
|
|
const {
|
|
terminal_new,
|
|
terminal_free,
|
|
terminal_print,
|
|
} = results.instance.exports;
|
|
|
|
const term = terminal_new(80, 80);
|
|
console.log(term);
|
|
terminal_free(term);
|
|
terminal_print('a');
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|