@devries-cameron20 / t3code Mirror · read-only / commits / 61560bef23
Fork 0

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 25, 17:15 UTC

fix bunpty lazy

Julius Marminge committed Feb 26, 2026 at 11:58 UTC 61560bef235fb6a04c36b99190a762713141e35a
1 file changed +17 -16
apps/server/src/terminal/Layers/BunPTY.ts
+17 -16
@@ -93,23 +93,24 @@ export const BunPtyAdapterLive = Layer.effect(
93 return yield* Effect.die("Bun PTY terminal support is unavailable on Windows.");
94 }
95 return {
96 - spawn: (input) => {
97 - let processHandle: BunPtyProcess | null = null;
98 - const command = [input.shell, ...(input.args ?? [])];
99 - const subprocess = Bun.spawn(command, {
100 - cwd: input.cwd,
101 - env: input.env,
102 - terminal: {
103 - cols: input.cols,
104 - rows: input.rows,
105 - data: (_terminal, data) => {
106 - processHandle?.emitData(data);
96 + spawn: (input) =>
97 + Effect.sync(() => {
98 + let processHandle: BunPtyProcess | null = null;
99 + const command = [input.shell, ...(input.args ?? [])];
100 + const subprocess = Bun.spawn(command, {
101 + cwd: input.cwd,
102 + env: input.env,
103 + terminal: {
104 + cols: input.cols,
105 + rows: input.rows,
106 + data: (_terminal, data) => {
107 + processHandle?.emitData(data);
108 + },
109 },
108 - },
109 - });
110 - processHandle = new BunPtyProcess(subprocess);
111 - return Effect.succeed(processHandle);
112 - },
110 + });
111 + processHandle = new BunPtyProcess(subprocess);
112 + return processHandle;
113 + }),
114 } satisfies PtyAdapterShape;
115 }),
116 );