From eb007f6e870f30a58c7aaf92fb293cdc393ba861 Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Thu, 4 Dec 2025 01:47:37 -0600 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A4=96=20feat:=20update=20ghostty-web?= =?UTF-8?q?=20to=20@next=20(0.3.0-next.13)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update ghostty-web from 0.2.1 to 0.3.0-next.13.g3dd4aef - Add required init() call before creating Terminal instances - Fix terminal.open() to be synchronous (API change in new version) New features in this version: - DSR response handling for nushell compatibility - Application cursor mode (DECCKM) for arrow keys - Dynamic font resizing support - Linefeed mode fix (newline properly moves cursor to column 0) - Text highlighting and copy/paste improvements _Generated with mux_ --- bun.lock | 4 ++-- package.json | 2 +- src/browser/components/TerminalView.tsx | 7 +++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/bun.lock b/bun.lock index 365d7afd8b..8fe559d08f 100644 --- a/bun.lock +++ b/bun.lock @@ -39,7 +39,7 @@ "electron-updater": "^6.6.2", "electron-window-state": "^5.0.3", "express": "^5.1.0", - "ghostty-web": "0.2.1", + "ghostty-web": "^0.3.0-next.13.g3dd4aef", "jsdom": "^27.2.0", "jsonc-parser": "^3.3.1", "lru-cache": "^11.2.2", @@ -2203,7 +2203,7 @@ "get-tsconfig": ["get-tsconfig@4.13.0", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ=="], - "ghostty-web": ["ghostty-web@0.2.1", "", {}, "sha512-wrovbPlHcl+nIkp7S7fY7vOTsmBjwMFihZEe2PJe/M6G4/EwuyJnwaWTTzNfuY7RcM/lVlN+PvGWqJIhKSB5hw=="], + "ghostty-web": ["ghostty-web@0.3.0-next.13.g3dd4aef", "", {}, "sha512-TeomyiuaVwv7lzHXhB/L0tvg/6XX4/ByyaCCRUvqTXfpoacgtcd0yWXV8EkXoFqoeguN3K+WR5QSn+XDNypcEg=="], "glob": ["glob@10.5.0", "", { "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" } }, "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg=="], diff --git a/package.json b/package.json index 764bbaca05..52ed6935a2 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "electron-updater": "^6.6.2", "electron-window-state": "^5.0.3", "express": "^5.1.0", - "ghostty-web": "0.2.1", + "ghostty-web": "^0.3.0-next.13.g3dd4aef", "jsdom": "^27.2.0", "jsonc-parser": "^3.3.1", "lru-cache": "^11.2.2", diff --git a/src/browser/components/TerminalView.tsx b/src/browser/components/TerminalView.tsx index b6e3a2a288..ab18b66c86 100644 --- a/src/browser/components/TerminalView.tsx +++ b/src/browser/components/TerminalView.tsx @@ -1,5 +1,5 @@ import { useRef, useEffect, useState } from "react"; -import { Terminal, FitAddon } from "ghostty-web"; +import { init, Terminal, FitAddon } from "ghostty-web"; import { useTerminalSession } from "@/browser/hooks/useTerminalSession"; import { useAPI } from "@/browser/contexts/API"; @@ -78,6 +78,9 @@ export function TerminalView({ workspaceId, sessionId, visible }: TerminalViewPr const initTerminal = async () => { try { + // Initialize ghostty-web WASM module (idempotent, safe to call multiple times) + await init(); + terminal = new Terminal({ fontSize: 13, fontFamily: "Monaco, Menlo, 'Courier New', monospace", @@ -110,7 +113,7 @@ export function TerminalView({ workspaceId, sessionId, visible }: TerminalViewPr const fitAddon = new FitAddon(); terminal.loadAddon(fitAddon); - await terminal.open(containerRef.current!); + terminal.open(containerRef.current!); fitAddon.fit(); const { cols, rows } = terminal; From ff716dc998cbe78b7706d5cf92a8427e9fcae6cb Mon Sep 17 00:00:00 2001 From: Jon Ayers Date: Thu, 4 Dec 2025 02:42:41 -0600 Subject: [PATCH 2/2] chore: update terminal theme to match ghostty-web demo - Use JetBrains Mono font (with Menlo/Monaco fallbacks) - Increase font size from 13 to 14 - Simplify theme to just background/foreground (use defaults for colors) --- src/browser/components/TerminalView.tsx | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/src/browser/components/TerminalView.tsx b/src/browser/components/TerminalView.tsx index ab18b66c86..ed5c663cde 100644 --- a/src/browser/components/TerminalView.tsx +++ b/src/browser/components/TerminalView.tsx @@ -82,31 +82,12 @@ export function TerminalView({ workspaceId, sessionId, visible }: TerminalViewPr await init(); terminal = new Terminal({ - fontSize: 13, - fontFamily: "Monaco, Menlo, 'Courier New', monospace", + fontSize: 14, + fontFamily: "JetBrains Mono, Menlo, Monaco, monospace", cursorBlink: true, theme: { background: "#1e1e1e", foreground: "#d4d4d4", - cursor: "#d4d4d4", - cursorAccent: "#1e1e1e", - selectionBackground: "#264f78", - black: "#000000", - red: "#cd3131", - green: "#0dbc79", - yellow: "#e5e510", - blue: "#2472c8", - magenta: "#bc3fbc", - cyan: "#11a8cd", - white: "#e5e5e5", - brightBlack: "#666666", - brightRed: "#f14c4c", - brightGreen: "#23d18b", - brightYellow: "#f5f543", - brightBlue: "#3b8eea", - brightMagenta: "#d670d6", - brightCyan: "#29b8db", - brightWhite: "#ffffff", }, });