Make Terminal a native feature

- Move the Terminal plugin into src/lib/features/terminal/ on the host Svelte runtime, with xterm 6.0.0 and addon-fit 0.11.0.
- Buttons, shortcuts, Help rows, and the close guard follow the Terminal switch. The first use loads the module.
- Add Settings → Terminal and the terminal settings section. The first start copies the old runestone.terminal key.
- The 16 ANSI colors come from the --rs-ansi-* tokens.
- Off asks first when a shell runs in any window (pty_running).
- Rust: no pty-data or pty-exit events, an owner check for write, resize, and close, output joined up to 64 KiB or 8 ms, and the sessions of a reloaded page close.
- Remove api.pty, the terminal contribution, TerminalSlot, and the plugin loader of the smoke harness.
- Check only the tested switches in the Background smoke test.
- Update the tests, the menu inventory, the docs, and UI-058.
This commit is contained in:
Knotty Wyvern
2026-10-29 19:02:58 -07:00
parent 53b9cea7f0
commit 833f793244
78 changed files with 2971 additions and 659 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ import path from "node:path";
import { fileURLToPath } from "node:url";
/** The feature folders. The runtime files directly in `src/lib/features/` stay in the main bundle. */
export const FEATURE_FOLDERS = ["git", "background"];
export const FEATURE_FOLDERS = ["git", "background", "terminal"];
/** Libraries that only features need. */
export const FEATURE_LIBRARIES = ["@xterm", "pdfjs-dist", "yaml"];
+4
View File
@@ -42,6 +42,10 @@ export const TABLE = {
terminal: {
plugin: { id: "runestone.terminal", repo: "runestone-terminal", tag: "v0.1.11", zip: `${PLUGIN_RELEASES}/RuneStone_Terminal/releases/runestone.terminal-0.1.11.zip` },
nativeKey: "terminal",
/**
* Both modes use the same names. Native: the ribbon button comes from the feature switch, and the first click loads
* the Terminal feature and xterm (src/lib/features/TerminalHost.svelte), so the action includes that load.
*/
ribbon: ".plugin-ribbon",
button: "Terminal",
surface: ".xterm",
+1 -1
View File
@@ -4,7 +4,7 @@ import { fileURLToPath } from 'node:url';
const root = fileURLToPath(new URL('../', import.meta.url));
const pluginRepos = process.env.RUNESTONE_PLUGIN_REPOS || path.resolve(root, '..');
export const projects = ['RuneStone', 'RuneStone_Project_Management', 'RuneStone_Terminal', 'RuneStone_Background_Slideshow', 'RuneStone_Local_Autocomplete', 'RuneStone_PDF_Viewer', 'RuneStone_CSV_Viewer'];
export const projects = ['RuneStone', 'RuneStone_Project_Management', 'RuneStone_Background_Slideshow', 'RuneStone_Local_Autocomplete', 'RuneStone_PDF_Viewer', 'RuneStone_CSV_Viewer'];
const patterns = {
action: /\b(?:showActionMenu|actionMenu)\s*\(/g,
svelteMenu: /<ContextMenu\b/g,
-2
View File
@@ -1,2 +0,0 @@
// RuneStone_Terminal imports this path for its smoke test. The helper lives in the shared smoke harness.
export * from "../tests/smoke/_harness/pluginMocks.mjs";
+1 -5
View File
@@ -6,7 +6,7 @@
// After the parallel run, the runner runs each failed test again, one at a time (--retries, default 1).
// A test that passes on a retry counts as "flaky". The summary lists it, but the run does not fail.
// A test declares what it needs on a line near the top:
// // @requires plugin:terminal repo:RuneStone_Git/dist electron
// // @requires repo:RuneStone_Project_Management/dist/plugin electron
// The runner skips a test, with the reason, when a requirement is missing.
// A test that fails because of a known app defect states it near the top:
// // @known-issue <the defect>
@@ -67,10 +67,6 @@ async function header(file) {
function missing(requirement) {
const [kind, value = ""] = requirement.split(/:(.*)/s);
if (kind === "plugin" && value === "terminal") {
const dist = env.RUNESTONE_TERMINAL_DIST || path.join(pluginRepos, "RuneStone_Terminal", "dist");
return existsSync(path.join(dist, "main.js")) ? null : `the Terminal plugin is not built at ${dist}`;
}
if (kind === "repo") {
const target = path.join(pluginRepos, value);
return existsSync(target) ? null : `${target} is missing; set RUNESTONE_PLUGIN_REPOS to the folder of the plugin checkouts`;