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:
@@ -20,34 +20,6 @@ export interface PluginDocumentType {
|
||||
create?: { label: string; defaultName: string; extension: string; contents(): string };
|
||||
mount(container: HTMLElement, document: PluginDocumentContext): void | Dispose | Promise<void | Dispose>;
|
||||
}
|
||||
export interface PtyProfile { id: string; title: string; kind: string }
|
||||
export interface PtyOpenOptions {
|
||||
/** The workspace root of the window. The host rejects the request when the workspace changed. */
|
||||
cwd: string;
|
||||
cols: number;
|
||||
rows: number;
|
||||
profile?: string;
|
||||
/** A start folder other than the workspace root. */
|
||||
directory?: string;
|
||||
/** Receives raw terminal output. UTF-8 characters can be split between two calls. */
|
||||
onData(data: Uint8Array): void;
|
||||
onExit?(code: number | null): void;
|
||||
}
|
||||
export interface PtySession {
|
||||
readonly id: string;
|
||||
write(data: string): Promise<void>;
|
||||
resize(cols: number, rows: number): Promise<void>;
|
||||
/** Stops the shell. Repeated calls return the same promise. */
|
||||
close(): Promise<void>;
|
||||
}
|
||||
/** Terminal sessions. The host closes the sessions of a plugin when the plugin stops. */
|
||||
export interface PtyApi {
|
||||
readonly version: 1;
|
||||
profiles(): Promise<PtyProfile[]>;
|
||||
open(options: PtyOpenOptions): Promise<PtySession>;
|
||||
openWindow(): Promise<void>;
|
||||
dictation(): Promise<void>;
|
||||
}
|
||||
export interface FolderGrant { id: string; path: string; name: string }
|
||||
export interface FolderEntry { name: string; size: number }
|
||||
/** Folders outside the workspace that the user granted to this plugin. */
|
||||
@@ -89,7 +61,6 @@ export interface AssetsApi { read(path: string): Promise<Uint8Array> }
|
||||
/** Interface parts that the host draws. */
|
||||
export interface UiApi { showActionMenu(options: ActionMenuOptions): { close(): void } }
|
||||
export interface PluginApi {
|
||||
pty?: PtyApi;
|
||||
files?: FilesApi;
|
||||
services?: ServicesApi;
|
||||
backgrounds?: BackgroundApi;
|
||||
|
||||
Reference in New Issue
Block a user