mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-31 13:42:50 +00:00
Restore configured terminal history on reconnect, retaining 10,000 rows plus the screen. Serialize the worker-owned xterm buffer directly to ANSI and forward negotiated bounded replay chunks while preserving ANSI-era clients and per-viewer live ordering. Preserve captured geometry through replay, bound pressure recovery to 500 rows, and keep the omitted visible-history default at 200. Remove the full cell-grid copy and obsolete JSON rendering. All 21 CI checks pass. Real browser, native Debug emulator/simulator and Linux Electron coverage and platform limits are documented in the PR. The Android Debug invalid native delegate dispatch also reproduces on upstream main; its cause and any change in frequency remain unproven. Credit Manav Dhindsa (DrakenKor), #6139 and #6148, and Lennart Schoch, #6743, for prior ANSI replay and retention work informing this change. Closes #6137. Closes #6147.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
export interface TerminalRendererReadyChange {
|
|
streamKey: string;
|
|
isReady: boolean;
|
|
}
|
|
|
|
export function applyTerminalRendererReadyChange(
|
|
currentReadyStreamKey: string | null,
|
|
change: TerminalRendererReadyChange,
|
|
): string | null {
|
|
if (change.isReady) {
|
|
return change.streamKey;
|
|
}
|
|
|
|
return currentReadyStreamKey === change.streamKey ? null : currentReadyStreamKey;
|
|
}
|
|
|
|
export function resolveTerminalStreamTarget(input: {
|
|
terminalId: string;
|
|
terminalStreamKey: string;
|
|
rendererReadyStreamKey: string | null;
|
|
isWorkspaceFocused: boolean;
|
|
}): string | null {
|
|
return input.isWorkspaceFocused && input.rendererReadyStreamKey === input.terminalStreamKey
|
|
? input.terminalId
|
|
: null;
|
|
}
|
|
|
|
export function shouldShowTerminalLoadingOverlay(input: {
|
|
isWorkspaceFocused: boolean;
|
|
hasStreamError: boolean;
|
|
isAttaching: boolean;
|
|
rendererReadyStreamKey: string | null;
|
|
terminalStreamKey: string;
|
|
}): boolean {
|
|
return (
|
|
input.isWorkspaceFocused &&
|
|
!input.hasStreamError &&
|
|
(input.isAttaching || input.rendererReadyStreamKey !== input.terminalStreamKey)
|
|
);
|
|
}
|