@@ -483,10 +483,10 @@ export default class TauriLaunchService {
483483
484484 // Set up environment variables for data directory isolation
485485 const envVarName = process . platform === 'linux' ? 'XDG_DATA_HOME' : 'TAURI_DATA_DIR' ;
486- const env = { ... process . env , ... workerOptions . env , [ envVarName ] : dataDir } ;
486+ process . env [ envVarName ] = dataDir ;
487487
488488 // Spawn tauri-driver for this worker
489- await this . startTauriDriverForWorker ( cid , port , nativePort , env , workerOptions ) ;
489+ await this . startTauriDriverForWorker ( cid , port , nativePort , workerOptions ) ;
490490
491491 // Update capabilities with allocated port so WDIO connects to correct port
492492 // This is critical - the worker needs to know which port to connect to
@@ -668,7 +668,6 @@ export default class TauriLaunchService {
668668 workerId : string ,
669669 port : number ,
670670 nativePort : number ,
671- env : NodeJS . ProcessEnv ,
672671 options ?: TauriServiceOptions ,
673672 ) : Promise < void > {
674673 console . log ( `[CONSOLE-DEBUG] startTauriDriverForWorker called for worker-${ workerId } ` ) ;
@@ -697,23 +696,13 @@ export default class TauriLaunchService {
697696 log . debug ( `[worker-${ workerId } ] Using native driver: ${ nativeDriverPath } ` ) ;
698697 }
699698
700- // Extract data directory from env for storage and merge with worker options
701- const customEnv = workerOptions . env || { } ;
702- const spawnEnv = { ...process . env , ...env , ...customEnv } ;
703- const dataDir = spawnEnv . XDG_DATA_HOME || spawnEnv . TAURI_DATA_DIR || '' ;
704-
705- // DEBUG: Log key environment variables being passed
706- log . debug ( `[worker-${ workerId } ] Environment debug:` ) ;
707- log . debug ( `[worker-${ workerId } ] ENABLE_SPLASH_WINDOW: ${ spawnEnv . ENABLE_SPLASH_WINDOW || 'not set' } ` ) ;
708- log . debug ( `[worker-${ workerId } ] XDG_DATA_HOME: ${ spawnEnv . XDG_DATA_HOME || 'not set' } ` ) ;
709- log . debug ( `[worker-${ workerId } ] TAURI_DATA_DIR: ${ spawnEnv . TAURI_DATA_DIR || 'not set' } ` ) ;
710- log . debug ( `[worker-${ workerId } ] DISPLAY: ${ spawnEnv . DISPLAY || 'not set' } ` ) ;
699+ // Extract data directory from env for storage
700+ const dataDir = process . env . XDG_DATA_HOME || process . env . TAURI_DATA_DIR || '' ;
711701
712702 await new Promise < void > ( ( resolve , reject ) => {
713703 const proc = spawn ( tauriDriverPath , args , {
714704 stdio : [ 'ignore' , 'pipe' , 'pipe' ] ,
715705 detached : false ,
716- env : spawnEnv ,
717706 } ) ;
718707
719708 log . info ( `[worker-${ workerId } ] Spawned process with PID: ${ proc . pid ?? 'unknown' } ` ) ;
@@ -871,25 +860,13 @@ export default class TauriLaunchService {
871860 }
872861
873862 return new Promise ( ( resolve , reject ) => {
874- // Use process.env as base and merge with any custom env from options
875- const customEnv = options . env || { } ;
876- const spawnEnv = { ...process . env , ...customEnv } ;
877-
878- // DEBUG: Log key environment variables being passed
879- log . debug ( `Environment debug (single driver):` ) ;
880- log . debug ( ` ENABLE_SPLASH_WINDOW: ${ spawnEnv . ENABLE_SPLASH_WINDOW || 'not set' } ` ) ;
881- log . debug ( ` XDG_DATA_HOME: ${ spawnEnv . XDG_DATA_HOME || 'not set' } ` ) ;
882- log . debug ( ` TAURI_DATA_DIR: ${ spawnEnv . TAURI_DATA_DIR || 'not set' } ` ) ;
883- log . debug ( ` DISPLAY: ${ spawnEnv . DISPLAY || 'not set' } ` ) ;
884-
885863 if ( process . platform === 'linux' ) {
886- log . info ( `Starting tauri-driver (DISPLAY from environment: ${ spawnEnv . DISPLAY || 'not set' } )` ) ;
864+ log . info ( `Starting tauri-driver (DISPLAY from environment: ${ process . env . DISPLAY || 'not set' } )` ) ;
887865 }
888866
889867 this . tauriDriverProcess = spawn ( tauriDriverPath , args , {
890868 stdio : [ 'ignore' , 'pipe' , 'pipe' ] ,
891869 detached : false ,
892- env : spawnEnv ,
893870 } ) ;
894871
895872 // Use readline for line-buffered log handling (fixes Windows chunking issues)
0 commit comments