feat: enhance terminal functionality and settings

- Added new endpoints for terminal settings: GET and PUT /settings to retrieve and update terminal configurations.
- Implemented session limit checks during session creation, returning a 429 status when the limit is reached.
- Introduced a new TerminalSection in settings view for customizing terminal appearance and behavior, including font family, default font size, line height, and screen reader mode.
- Added support for new terminal features such as search functionality and improved error handling with a TerminalErrorBoundary component.
- Updated terminal layout persistence to include session IDs for reconnection and enhanced terminal state management.
- Introduced new keyboard shortcuts for terminal actions, including creating new terminal tabs.
- Enhanced UI with scrollbar theming for terminal components.
This commit is contained in:
SuperComboGamer
2025-12-20 22:56:25 -05:00
parent 8fcc6cb4db
commit 195b98e688
24 changed files with 2729 additions and 149 deletions

View File

@@ -217,6 +217,44 @@ export class HttpApiClient implements ElectronAPI {
return { success: true };
}
async openInEditor(
filePath: string,
line?: number,
column?: number
): Promise<{ success: boolean; error?: string }> {
// Build VS Code URL scheme: vscode://file/path:line:column
// This works on systems where VS Code's URL handler is registered
// URL encode the path to handle special characters (spaces, brackets, etc.)
// but preserve the leading slash for absolute paths
const encodedPath = filePath.startsWith('/')
? '/' + filePath.slice(1).split('/').map(encodeURIComponent).join('/')
: filePath.split('/').map(encodeURIComponent).join('/');
let url = `vscode://file${encodedPath}`;
if (line !== undefined && line > 0) {
url += `:${line}`;
if (column !== undefined && column > 0) {
url += `:${column}`;
}
}
try {
// Use anchor click approach which is most reliable for custom URL schemes
// This triggers the browser's URL handler without navigation issues
const anchor = document.createElement("a");
anchor.href = url;
anchor.style.display = "none";
document.body.appendChild(anchor);
anchor.click();
document.body.removeChild(anchor);
return { success: true };
} catch (error) {
return {
success: false,
error: error instanceof Error ? error.message : "Failed to open in editor",
};
}
}
// File picker - uses server-side file browser dialog
async openDirectory(): Promise<DialogResult> {
const fileBrowser = getGlobalFileBrowser();