Lines 2494-2534javascript
2495 const info = refreshClientServiceUnitForUpdate();
2496 print.line(` refresh-unit: ${info.platform} supervisor definition rewritten at ${info.unitPath}\n`);
2498 const msg = err instanceof Error ? err.message : String(err);
2499 print.line(` refresh-unit: failed to rewrite supervisor definition: ${msg}\n`);
2505//#region src/commands/daemon/restart.ts
2506function registerDaemonRestartCommand(daemon) {
2507 daemon.command("restart").description("Restart the background service").action(() => {
2508 if (!isServiceSupported()) {
2509 if (process.platform === "win32") {
2510 print.line("\n Service control is not supported on Windows.\n");
2511 print.line(" First Tree runs inline on this platform.\n\n");
2512 print.line(" If you are onboarding and need to refresh detected agents:\n");
2513 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2514 print.line(" If you need to restart the inline daemon:\n");
2515 print.line(` stop the PowerShell running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2516 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2518 print.line(`\n Service control is not supported on ${process.platform}.\n`);
2519 print.line(" First Tree runs inline on this platform.\n\n");
2520 print.line(" If you are onboarding and need to refresh detected agents:\n");
2521 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2522 print.line(" If you need to restart the inline daemon:\n");
2523 print.line(` stop the terminal running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2524 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2528 if (getClientServiceStatus().state === "not-installed") {
2529 print.line("\n No background service installed.\n");
2530 print.line(` Run \`${channelConfig.binName} login <code>\` first.\n\n`);
2533 const res = restartClientService();