fix(cursor): save credentials after auto-detect and fix signal hang

- handleAuth() now calls saveCredentials() after successful auto-detect
- Handle code === null (signal kill) in daemon exit handler to prevent
  promise from hanging indefinitely
- Remove unnecessary await on synchronous functions
This commit is contained in:
Tam Nhu Tran
2026-02-12 04:11:31 +07:00
parent 9f0ea25448
commit 9f9db7dcea
2 changed files with 17 additions and 5 deletions
+7 -2
View File
@@ -207,9 +207,14 @@ export async function startDaemon(
});
});
proc.on('exit', (code) => {
proc.on('exit', (code, signal) => {
clearInterval(checkInterval);
if (code === 0) {
if (code === null) {
resolve({
success: false,
error: `Daemon process was killed by signal ${signal}`,
});
} else if (code === 0) {
resolve({
success: false,
error: 'Daemon process exited unexpectedly with code 0',