diff --git a/client/src/driver/BitbakeDriver.ts b/client/src/driver/BitbakeDriver.ts index ef0312ab..2f6b2b2d 100644 --- a/client/src/driver/BitbakeDriver.ts +++ b/client/src/driver/BitbakeDriver.ts @@ -46,17 +46,15 @@ export class BitbakeDriver { /// Execute a command in the bitbake environment async spawnBitbakeProcess (command: string): Promise { - const { shell, script } = this.prepareCommand(command) - const cwd = this.getBuildConfig('workingDirectory') - const shellEnv = this.getBuildConfig('shellEnv') + const { shell, shellEnv, script, workingDirectory } = this.prepareCommand(command) await this.waitForBitbakeToFinish() - logger.debug(`Executing Bitbake command with ${shell} in ${cwd}: ${script}`) + logger.debug(`Executing Bitbake command with ${shell} in ${workingDirectory}: ${script}`) const child = pty.spawn( shell, ['-c', script], { - cwd: typeof(cwd) === 'string' ? cwd : undefined, - env: { ...process.env, ...(typeof shellEnv === 'object' ? shellEnv : {}) } + cwd: workingDirectory, + env: shellEnv } ) this.bitbakeProcess = child @@ -86,7 +84,7 @@ export class BitbakeDriver { } { const shell = process.env.SHELL ?? '/bin/sh' const tempShellEnv = this.getBuildConfig('shellEnv') - const shellEnv = typeof tempShellEnv === 'object' ? tempShellEnv : {} + const shellEnv = {...process.env, ...(typeof tempShellEnv === 'object' ? tempShellEnv : {}) } const script = this.composeBitbakeScript(command) const tempWorkingDirectory = this.getBuildConfig('workingDirectory') const workingDirectory = typeof tempWorkingDirectory === 'string' ? tempWorkingDirectory : '.' diff --git a/client/src/ui/BitbakeTerminalProfile.ts b/client/src/ui/BitbakeTerminalProfile.ts index 9bbef52c..cf2dea89 100644 --- a/client/src/ui/BitbakeTerminalProfile.ts +++ b/client/src/ui/BitbakeTerminalProfile.ts @@ -29,6 +29,7 @@ export class BitbakeTerminalProfileProvider implements vscode.TerminalProfilePro shellPath: shell, shellArgs: ['-c', script], env: shellEnv, + strictEnv: true, cwd: workingDirectory, iconPath: vscode.Uri.file(path.resolve(__dirname, '../../images/yocto-view-icon.svg')) } satisfies vscode.TerminalOptions