Lines 2405-2445javascript
2406 const info = refreshClientServiceUnitForUpdate();
2407 print.line(` refresh-unit: ${info.platform} supervisor definition rewritten at ${info.unitPath}\n`);
2409 const msg = err instanceof Error ? err.message : String(err);
2410 print.line(` refresh-unit: failed to rewrite supervisor definition: ${msg}\n`);
2416//#region src/commands/daemon/restart.ts
2417function registerDaemonRestartCommand(daemon) {
2418 daemon.command("restart").description("Restart the background service").action(() => {
2419 if (!isServiceSupported()) {
2420 if (process.platform === "win32") {
2421 print.line("\n Service control is not supported on Windows.\n");
2422 print.line(" First Tree runs inline on this platform.\n\n");
2423 print.line(" If you are onboarding and need to refresh detected agents:\n");
2424 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2425 print.line(" If you need to restart the inline daemon:\n");
2426 print.line(` stop the PowerShell running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2427 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2429 print.line(`\n Service control is not supported on ${process.platform}.\n`);
2430 print.line(" First Tree runs inline on this platform.\n\n");
2431 print.line(" If you are onboarding and need to refresh detected agents:\n");
2432 print.line(` ${channelConfig.binName} daemon probe\n\n`);
2433 print.line(" If you need to restart the inline daemon:\n");
2434 print.line(` stop the terminal running \`${channelConfig.binName} daemon start\` with Ctrl+C,\n`);
2435 print.line(` then run \`${channelConfig.binName} daemon start\` again.\n\n`);
2439 if (getClientServiceStatus().state === "not-installed") {
2440 print.line("\n No background service installed.\n");
2441 print.line(` Run \`${channelConfig.binName} login <code>\` first.\n\n`);
2444 const res = restartClientService();