unsable code rework, doesnt run

This commit is contained in:
2026-02-23 17:15:28 +01:00
parent 1faab39849
commit 9ac27f5fbd
19 changed files with 287 additions and 189 deletions

View File

@@ -0,0 +1,43 @@
import { mount, unmount } from 'svelte';
import Output from '../../../../modules/terminal/Output.svelte';
import { isInitializing } from '../init.svelte';
import type { PrintData } from '../terminal';
interface OutputProps {
path: string;
output: any;
cmd: string;
}
const outputInstances = new Set<Output>();
function appendOutput(container: HTMLElement, props: OutputProps): Output | undefined {
if (!container) return;
const instance = mount(Output, {
target: container,
props
});
outputInstances.add(instance);
return instance;
}
export function print(e: HTMLElement, data: PrintData): void {
if(data.cmd == 'clear') return;
if (isInitializing()) {
console.error('Terminal is initializing! Skipping Print');
return;
}
appendOutput(e, {
path: data.path,
output: data.output,
cmd: data.cmd
});
}
export function clear(): void {
for(const instance of outputInstances) {
unmount(instance, {});
}
}