Working xtermjs!

This commit is contained in:
EthanShoeDev
2025-09-18 00:17:35 -04:00
parent 7c448e2ec3
commit 808f476bac
4 changed files with 55 additions and 22 deletions

View File

@@ -245,8 +245,15 @@ function wrapShellSession(shell: GeneratedRussh.ShellSessionInterface): SshShell
}
} satisfies GeneratedRussh.ShellListener;
const id = shell.addListener(listener, { cursor: cursorToGenerated(opts.cursor), coalesceMs: opts.coalesceMs });
return BigInt(id);
try {
const id = shell.addListener(listener, { cursor: cursorToGenerated(opts.cursor), coalesceMs: opts.coalesceMs });
if (id === 0n) {
throw new Error('Failed to attach shell listener (id=0)');
}
return BigInt(id);
} catch (e) {
throw new Error(`addListener failed: ${String((e as any)?.message ?? e)}`);
}
};
return {