Make mobile terminals load faster (#1147)
* Speed up terminal restores on mobile * Preserve terminal output bytes in the app
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
import { createTerminal, type TerminalSession, type TerminalStateSnapshot } from "./terminal.js";
|
||||
import {
|
||||
createTerminal,
|
||||
type TerminalSession,
|
||||
type TerminalStateSnapshot,
|
||||
type TerminalStateSnapshotOptions,
|
||||
} from "./terminal.js";
|
||||
import { captureTerminalLines, type CaptureTerminalLinesResult } from "./terminal-capture.js";
|
||||
import { resolve, sep, win32, posix } from "node:path";
|
||||
|
||||
@@ -29,7 +34,10 @@ export interface TerminalManager {
|
||||
}): Promise<TerminalSession>;
|
||||
registerCwdEnv(options: { cwd: string; env: Record<string, string> }): void;
|
||||
getTerminal(id: string): TerminalSession | undefined;
|
||||
getTerminalState(id: string): Promise<TerminalStateSnapshot | null>;
|
||||
getTerminalState(
|
||||
id: string,
|
||||
options?: TerminalStateSnapshotOptions,
|
||||
): Promise<TerminalStateSnapshot | null>;
|
||||
setTerminalTitle(id: string, title: string): boolean;
|
||||
killTerminal(id: string): void;
|
||||
killTerminalAndWait(
|
||||
@@ -208,8 +216,11 @@ export function createTerminalManager(): TerminalManager {
|
||||
return terminalsById.get(id);
|
||||
},
|
||||
|
||||
async getTerminalState(id: string): Promise<TerminalStateSnapshot | null> {
|
||||
return terminalsById.get(id)?.getStateSnapshot() ?? null;
|
||||
async getTerminalState(
|
||||
id: string,
|
||||
options?: TerminalStateSnapshotOptions,
|
||||
): Promise<TerminalStateSnapshot | null> {
|
||||
return terminalsById.get(id)?.getStateSnapshot(options) ?? null;
|
||||
},
|
||||
|
||||
setTerminalTitle(id: string, title: string): boolean {
|
||||
|
||||
Reference in New Issue
Block a user