Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
"@vercel/functions": "^3.4.3",
"@vercel/otel": "^2.1.1",
"@workos-inc/node": "catalog:",
"@xterm/addon-clipboard": "^0.2.0",
"@xterm/addon-fit": "^0.11.0",
"@xterm/addon-web-links": "^0.12.0",
"@xterm/xterm": "^6.0.0",
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions src/components/gastown/useXtermPty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,14 @@ export function useXtermPty({
if (!container) return;

// Lazy-load xterm.js to avoid SSR issues and minimize bundle impact
const [{ Terminal }, { FitAddon }, { WebLinksAddon }] = await Promise.all([
import('@xterm/xterm'),
import('@xterm/addon-fit'),
import('@xterm/addon-web-links'),
]);
const [{ Terminal }, { FitAddon }, { WebLinksAddon }, { ClipboardAddon }] = await Promise.all(
[
import('@xterm/xterm'),
import('@xterm/addon-fit'),
import('@xterm/addon-web-links'),
import('@xterm/addon-clipboard'),
]
);

if (disposed) return;

Expand All @@ -305,6 +308,7 @@ export function useXtermPty({

const fitAddon = new FitAddon();
const webLinksAddon = new WebLinksAddon();
const clipboardAddon = new ClipboardAddon();

const term = new Terminal({
cursorBlink: true,
Expand All @@ -323,6 +327,7 @@ export function useXtermPty({

term.loadAddon(fitAddon);
term.loadAddon(webLinksAddon);
term.loadAddon(clipboardAddon);
term.open(container);
attachKittyEnterHandler(term, wsRef);
fitAddon.fit();
Expand Down