mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: improve error handling in terminal settings retrieval and enhance path normalization
- Wrapped the terminal settings retrieval in a try-catch block to handle potential errors and respond with a 500 status and error details. - Updated path normalization logic to skip resolution for WSL UNC paths, preventing potential issues with path handling in Windows Subsystem for Linux. - Enhanced unit tests for session termination to include timer-based assertions for graceful session killing.
This commit is contained in:
@@ -181,8 +181,10 @@ export class TerminalService extends EventEmitter {
|
||||
}
|
||||
|
||||
// Normalize the path to resolve . and .. segments
|
||||
// This converts relative paths to absolute and cleans up the path
|
||||
cwd = path.resolve(cwd);
|
||||
// Skip normalization for WSL UNC paths as path.resolve would break them
|
||||
if (!cwd.startsWith("//wsl")) {
|
||||
cwd = path.resolve(cwd);
|
||||
}
|
||||
|
||||
// Check if path exists and is a directory
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user