+ {/* Header / Toolbar */}
+
+
Terminal
+
+
+ setInputCwd(e.target.value)}
+ placeholder="Working directory..."
+ className="px-3 py-1.5 text-sm bg-[#3c3c3c] text-[#d4d4d4] border border-[#3c3c3c] rounded focus:outline-none focus:border-[#007acc] w-64"
+ />
+
+
+
+
+
+
+ {isConnected ? 'Connected' : isConnecting ? 'Connecting...' : 'Disconnected'}
+
+
+
+ {isConnected && (
+
+ )}
+
+
+ {/* Error message */}
+ {error && (
+
+ {error}
+
+ )}
+
+ {/* Terminal viewport */}
+
+ {isConnected ? (
+
+ ) : (
+
+ {isConnecting ? 'Connecting to terminal...' : 'Click "Connect" to start a terminal session'}
+
+ )}
+
+
+ {/* Footer */}
+
+ {cwd}
+ {isConnected ? 'Connected' : 'Not connected'}
+
+
+ );
+}
+
+export default App;
diff --git a/src/components/TerminalViewport.tsx b/src/components/TerminalViewport.tsx
new file mode 100644
index 0000000..ad11714
--- /dev/null
+++ b/src/components/TerminalViewport.tsx
@@ -0,0 +1,1566 @@
+import React from 'react';
+import { createPortal } from 'react-dom';
+import { Ghostty, Terminal as GhosttyTerminal, FitAddon } from 'ghostty-web';
+
+import { isMobileDeviceViaCSS } from '../lib/utils';
+import type { TerminalTheme } from '../lib/terminalTheme';
+import { getGhosttyTerminalOptions } from '../lib/terminalTheme';
+import type { TerminalChunk } from '../stores/useTerminalStore';
+import { copyTextToClipboard } from '../lib/utils';
+import { cn } from '../lib/utils';
+
+let ghosttyPromise: Promise