@@ -3,6 +3,8 @@ import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
33import { tmpdir } from "node:os" ;
44import { join } from "node:path" ;
55
6+ const repoRoot = process . cwd ( ) ;
7+ const sourceEntrypoint = join ( repoRoot , "src/main.tsx" ) ;
68const tempDirs : string [ ] = [ ] ;
79const ttyToolsAvailable = Bun . spawnSync ( [ "bash" , "-lc" , "command -v script >/dev/null && command -v timeout >/dev/null" ] , {
810 stdin : "ignore" ,
@@ -117,9 +119,9 @@ async function runTtySmoke(options: { mode?: "split" | "stack"; pager?: boolean;
117119 args . push ( "--agent-context" , fixture . agent ) ;
118120 }
119121
120- const command = `timeout 2 bun run src/main.tsx ${ args . map ( shellQuote ) . join ( " " ) } ` ;
122+ const command = `timeout 2 bun run ${ shellQuote ( sourceEntrypoint ) } ${ args . map ( shellQuote ) . join ( " " ) } ` ;
121123 const proc = Bun . spawnSync ( [ "script" , "-q" , "-f" , "-e" , "-c" , command , transcript ] , {
122- cwd : process . cwd ( ) ,
124+ cwd : fixture . dir ,
123125 stdin : "ignore" ,
124126 stdout : "pipe" ,
125127 stderr : "pipe" ,
@@ -141,11 +143,11 @@ async function runStdinPagerSmoke(options?: { input?: string; inputCommand?: str
141143 const fixture = createFixtureFiles ( options ?. lines ?? 1 ) ;
142144 const transcript = join ( fixture . dir , "stdin-pager-transcript.txt" ) ;
143145 const subcommand = options ?. command === "pager" ? "pager" : "patch -" ;
144- const patchCommand = `cat ${ shellQuote ( fixture . coloredPatch ) } | bun run src/main.tsx ${ subcommand } ` ;
146+ const patchCommand = `cat ${ shellQuote ( fixture . coloredPatch ) } | bun run ${ shellQuote ( sourceEntrypoint ) } ${ subcommand } ` ;
145147 const scriptCommand = `timeout 5 script -q -f -e -c ${ shellQuote ( patchCommand ) } ${ shellQuote ( transcript ) } ` ;
146148 const inputCommand = options ?. inputCommand ?? `(sleep 1; printf ${ shellQuote ( options ?. input ?? "q" ) } )` ;
147149 const proc = Bun . spawnSync ( [ "bash" , "-lc" , `${ inputCommand } | ${ scriptCommand } ` ] , {
148- cwd : process . cwd ( ) ,
150+ cwd : fixture . dir ,
149151 stdin : "ignore" ,
150152 stdout : "pipe" ,
151153 stderr : "pipe" ,
0 commit comments