feat: increase maximum terminal session limit and improve path handling

- Updated the maximum terminal session limit from 500 to 1000 to accommodate more concurrent sessions.
- Enhanced path handling in the editor and HTTP API client to normalize file paths for both Unix and Windows systems, ensuring consistent URL encoding.
This commit is contained in:
SuperComboGamer
2025-12-20 23:13:30 -05:00
parent 18ccfa21e0
commit 0e944e274a
3 changed files with 11 additions and 8 deletions

View File

@@ -225,10 +225,11 @@ export class HttpApiClient implements ElectronAPI {
// 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('/');
// Handle both Unix (/) and Windows (\) path separators
const normalizedPath = filePath.replace(/\\/g, '/');
const encodedPath = normalizedPath.startsWith('/')
? '/' + normalizedPath.slice(1).split('/').map(encodeURIComponent).join('/')
: normalizedPath.split('/').map(encodeURIComponent).join('/');
let url = `vscode://file${encodedPath}`;
if (line !== undefined && line > 0) {
url += `:${line}`;

View File

@@ -417,9 +417,11 @@ ipcMain.handle("shell:openInEditor", async (_, filePath: string, line?: number,
// Build VS Code URL scheme: vscode://file/path:line:column
// This works on all platforms where VS Code is installed
// URL encode the path to handle special characters (spaces, brackets, etc.)
const encodedPath = filePath.startsWith('/')
? '/' + filePath.slice(1).split('/').map(encodeURIComponent).join('/')
: filePath.split('/').map(encodeURIComponent).join('/');
// Handle both Unix (/) and Windows (\) path separators
const normalizedPath = filePath.replace(/\\/g, '/');
const encodedPath = normalizedPath.startsWith('/')
? '/' + normalizedPath.slice(1).split('/').map(encodeURIComponent).join('/')
: normalizedPath.split('/').map(encodeURIComponent).join('/');
let url = `vscode://file${encodedPath}`;
if (line !== undefined && line > 0) {
url += `:${line}`;