mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-08 20:58:45 +02:00
feat: add integrated terminal backend
- add a PTY manager with platform shell resolution and streamed data/exit events - expose terminal lifecycle and terminal height IPC through preload and app service - persist terminal panel height in workspace settings and document the backend contract - add backend tests and validate native packaging with bun run package Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export interface TerminalSnapshot {
|
||||
cwd: string;
|
||||
shell: string;
|
||||
pid: number;
|
||||
cols: number;
|
||||
rows: number;
|
||||
}
|
||||
|
||||
export interface TerminalExitInfo {
|
||||
exitCode: number;
|
||||
signal?: number;
|
||||
}
|
||||
@@ -63,6 +63,7 @@ export interface WorkspaceSettings {
|
||||
theme: AppearanceTheme;
|
||||
tooling: WorkspaceToolingSettings;
|
||||
discoveredUserTooling: DiscoveredToolingState;
|
||||
terminalHeight?: number;
|
||||
}
|
||||
|
||||
export interface SessionToolingSelection {
|
||||
@@ -185,7 +186,17 @@ export function normalizeTheme(value?: string): AppearanceTheme {
|
||||
return validThemes.has(value ?? '') ? (value as AppearanceTheme) : 'dark';
|
||||
}
|
||||
|
||||
export function normalizeTerminalHeight(value?: number): number | undefined {
|
||||
if (typeof value !== 'number' || !Number.isFinite(value)) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const normalized = Math.round(value);
|
||||
return normalized >= 120 ? normalized : undefined;
|
||||
}
|
||||
|
||||
export function normalizeWorkspaceSettings(settings?: Partial<WorkspaceSettings>): WorkspaceSettings {
|
||||
const terminalHeight = normalizeTerminalHeight(settings?.terminalHeight);
|
||||
return {
|
||||
theme: normalizeTheme(settings?.theme),
|
||||
tooling: {
|
||||
@@ -193,6 +204,7 @@ export function normalizeWorkspaceSettings(settings?: Partial<WorkspaceSettings>
|
||||
lspProfiles: (settings?.tooling?.lspProfiles ?? []).map(normalizeLspProfileDefinition),
|
||||
},
|
||||
discoveredUserTooling: normalizeDiscoveredToolingState(settings?.discoveredUserTooling),
|
||||
...(terminalHeight !== undefined ? { terminalHeight } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user