The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 23, 20:30 UTC
fix(desktop): print version before initializing the app (#15440)
maria committed
Oct 4, 2026 at 08:21 UTC
e01e58916fa51ec52389cabba1b5fbba6344723d
1 file changed
+11
apps/desktop/src/main.ts
+11
@@ -8,6 +8,8 @@ for (const stream of [process.stdout, process.stderr]) {
8
import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
9
import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
10
import * as NodeServices from "@effect/platform-node/NodeServices";
11
+// @effect-diagnostics-next-line nodeBuiltinImport:off - Version output must flush before Electron exits, without acquiring the runtime.
12
+import * as NodeFS from "node:fs";
13
import * as NodeOS from "node:os";
14
import * as Effect from "effect/Effect";
15
import * as Layer from "effect/Layer";
@@ -69,6 +71,15 @@ import * as DesktopWslBackend from "./wsl/DesktopWslBackend.ts";
71
import * as DesktopWslEnvironment from "./wsl/DesktopWslEnvironment.ts";
72
import * as DesktopWslServerTree from "./wsl/DesktopWslServerTree.ts";
73
74
+if (process.argv.includes("--version")) {
75
+ try {
76
+ NodeFS.writeSync(process.stdout.fd, `${Electron.app.getVersion()}\n`);
77
+ } catch (error) {
78
+ if (!(error instanceof Error) || !("code" in error) || error.code !== "EPIPE") throw error;
79
+ }
80
+ Electron.app.exit(0);
81
+}
82
+
83
const desktopEnvironmentLayer = Layer.unwrap(
84
Effect.gen(function* () {
85
const metadata = yield* Effect.service(ElectronApp.ElectronApp).pipe(