This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Ensure cwd, resume stdin

Nathan Herald (Mar 9, 2026, 9:26 PM +0100) 8f953cac 7e53baf9

+15 -6
+5 -4
src/cli.ts
··· 281 281 282 282 // Restart 283 283 cleanupAll(session.name); 284 - await spawnDaemon(session.name, meta.command, meta.args, meta.displayCommand); 284 + await spawnDaemon(session.name, meta.command, meta.args, meta.displayCommand, meta.cwd); 285 285 console.log(`Session "${session.name}" restarted.`); 286 286 doAttach(session.name); 287 287 } ··· 394 394 } 395 395 396 396 cleanupAll(name); 397 - await spawnDaemon(name, meta.command, meta.args, meta.displayCommand); 397 + await spawnDaemon(name, meta.command, meta.args, meta.displayCommand, meta.cwd); 398 398 console.log(`Session "${name}" restarted.`); 399 399 doAttach(name); 400 400 } ··· 403 403 name: string, 404 404 command: string, 405 405 args: string[], 406 - displayCommand: string 406 + displayCommand: string, 407 + cwd?: string 407 408 ): Promise<void> { 408 409 const stdout = process.stdout as tty.WriteStream; 409 410 const rows = stdout.rows ?? 24; ··· 416 417 command, 417 418 args, 418 419 displayCommand, 419 - cwd: process.cwd(), 420 + cwd: cwd ?? process.cwd(), 420 421 rows, 421 422 cols, 422 423 });
+8
src/client.ts
··· 73 73 } 74 74 // All other input is silently ignored (read-only) 75 75 }); 76 + stdin.resume(); 76 77 } 77 78 }); 78 79 ··· 215 216 socket.write(encodeData(Buffer.from(forward).toString())); 216 217 } 217 218 }); 219 + 220 + // Explicitly resume stdin. We cannot rely on the auto-resume from 221 + // .on("data") because Node.js skips it when _readableState.flowing 222 + // is exactly `false` (as opposed to the initial `null`). This state 223 + // can be left behind by readline (restart prompt) or other code that 224 + // previously consumed stdin. 225 + stdin.resume(); 218 226 219 227 // Handle terminal resize 220 228 if (stdout instanceof tty.WriteStream) {
+2 -2
tests/screenshot.test.ts
··· 20 20 // All tests run in a tmp directory to avoid polluting the project 21 21 const testCwd = fs.mkdtempSync(path.join(os.tmpdir(), "pty-ss-")); 22 22 afterAll(() => { 23 - fs.rmSync(testCwd, { recursive: true, force: true }); 23 + fs.rmSync(testCwd, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); 24 24 }); 25 25 26 26 // ─── Types ─── ··· 291 291 } 292 292 sessionNames = []; 293 293 for (const dir of tmpDirs) { 294 - fs.rmSync(dir, { recursive: true, force: true }); 294 + fs.rmSync(dir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 }); 295 295 } 296 296 tmpDirs = []; 297 297 });