From 28f1bf98b6ac1fc4bb35b32b48faeded2b62ad71 Mon Sep 17 00:00:00 2001 From: Teodor Calin Date: Sun, 13 Sep 2026 03:31:44 +0300 Subject: [PATCH] Make xterm the explicit default renderer --- CHANGELOG.md | 2 +- app/README.md | 2 +- app/src/routes/Workspace.tsx | 2 +- app/src/terminal/renderer.ts | 7 +++++-- docs/content.json | 2 +- web/main.ts | 2 +- web/terminal-renderer.ts | 5 +++-- 7 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 500bf05..fed6ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ All notable user-visible changes are recorded here. Versions follow [Semantic Ve ### Added - A persisted terminal renderer dropdown in public shares and signed-in - session tabs. xterm.js remains the default; Refstream can be selected without + session tabs. xterm.js is the default; Refstream (alpha) can be selected without changing the process, relay protocol, encryption, or session permissions. - Refstream mode now mounts its terminal-native find, command inspection, retained-output download, eight themes, text sizing, and back-to-live tools diff --git a/app/README.md b/app/README.md index b78b2e4..8e91df2 100644 --- a/app/README.md +++ b/app/README.md @@ -88,7 +88,7 @@ The full relay and app setup is documented in [the self-hosting guide](../docs/s - `src/` — React client - `server/` — API, stores, and migrations - `worker/` — Cloudflare Worker adapter -- `src/terminal/` — relay protocol, E2EE, and selectable xterm.js/Refstream rendering; Refstream mode includes its local find, command, export, theme, sizing, and back-to-live tools +- `src/terminal/` — relay protocol, E2EE, and selectable rendering; xterm.js is the default and Refstream (alpha) includes local find, command, export, theme, sizing, and back-to-live tools - `scripts/` — build and deployment checks `npm run check:protocol` verifies that the app's terminal protocol files match diff --git a/app/src/routes/Workspace.tsx b/app/src/routes/Workspace.tsx index b4bf1b4..f17f83a 100644 --- a/app/src/routes/Workspace.tsx +++ b/app/src/routes/Workspace.tsx @@ -696,7 +696,7 @@ export function Workspace() { }} > - + diff --git a/app/src/terminal/renderer.ts b/app/src/terminal/renderer.ts index 33b707d..a4d455b 100644 --- a/app/src/terminal/renderer.ts +++ b/app/src/terminal/renderer.ts @@ -6,6 +6,7 @@ import { import { Terminal as RefstreamTerminal } from "../../../web/vendor/refstream/v0.1.0-alpha.2/refstream.js"; export type TerminalRenderer = "xterm" | "refstream"; +export const DEFAULT_TERMINAL_RENDERER: TerminalRenderer = "xterm"; type TerminalOptions = ITerminalOptions & ITerminalInitOnlyOptions; export interface TerminalSurface { @@ -30,9 +31,11 @@ const STORAGE_KEY = "shell-online-terminal-renderer"; export function readTerminalRenderer(): TerminalRenderer { try { - return localStorage.getItem(STORAGE_KEY) === "refstream" ? "refstream" : "xterm"; + return localStorage.getItem(STORAGE_KEY) === "refstream" + ? "refstream" + : DEFAULT_TERMINAL_RENDERER; } catch { - return "xterm"; + return DEFAULT_TERMINAL_RENDERER; } } diff --git a/docs/content.json b/docs/content.json index c3111b6..7af6a0a 100644 --- a/docs/content.json +++ b/docs/content.json @@ -77,7 +77,7 @@ ], [ "Choose the renderer", - "Terminal controls include a persisted renderer dropdown for xterm.js or Refstream. xterm.js remains the default. Refstream mode adds find, command inspection when the process emits shell markers, retained-output download, built-in themes, text sizing, and a back-to-live shortcut. Switching reopens only the browser view; the process, encryption, permissions, fixed session grid, and relay connection model do not change." + "Terminal controls include a persisted renderer dropdown. xterm.js is the default; Refstream (alpha) is available as an experimental alternative. Refstream mode adds find, command inspection when the process emits shell markers, retained-output download, built-in themes, text sizing, and a back-to-live shortcut. Switching reopens only the browser view; the process, encryption, permissions, fixed session grid, and relay connection model do not change." ], [ "Large paste, bounded", diff --git a/web/main.ts b/web/main.ts index 9e62ee4..c4c0e18 100644 --- a/web/main.ts +++ b/web/main.ts @@ -695,7 +695,7 @@ function renderTerminal(sessionId: string): void {
Changing renderer reopens this view. diff --git a/web/terminal-renderer.ts b/web/terminal-renderer.ts index 7401474..2abf582 100644 --- a/web/terminal-renderer.ts +++ b/web/terminal-renderer.ts @@ -6,6 +6,7 @@ import { import { Terminal as RefstreamTerminal } from "./vendor/refstream/v0.1.0-alpha.2/refstream.js"; export type TerminalRenderer = "xterm" | "refstream"; +export const DEFAULT_TERMINAL_RENDERER: TerminalRenderer = "xterm"; type TerminalOptions = ITerminalOptions & ITerminalInitOnlyOptions; export interface TerminalSurface { @@ -43,9 +44,9 @@ export function readTerminalRenderer(): TerminalRenderer { try { return localStorage.getItem(TERMINAL_RENDERER_STORAGE_KEY) === "refstream" ? "refstream" - : "xterm"; + : DEFAULT_TERMINAL_RENDERER; } catch { - return "xterm"; + return DEFAULT_TERMINAL_RENDERER; } }