From 16f337a2d77c8a47effd362fcfd9bb9fcec9f523 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 28 Jun 2023 16:36:44 +0200 Subject: [PATCH] fix env shell --- apps/remixdesktop/src/plugins/xtermPlugin.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/src/plugins/xtermPlugin.ts b/apps/remixdesktop/src/plugins/xtermPlugin.ts index bf0673fa41..9555fa3eaa 100644 --- a/apps/remixdesktop/src/plugins/xtermPlugin.ts +++ b/apps/remixdesktop/src/plugins/xtermPlugin.ts @@ -94,12 +94,21 @@ class XtermPluginClient extends ElectronBasePluginClient { console.log('defaultShell', defaultShell) + // filter undefined out of the env + const env = Object.keys(process.env) + .filter(key => process.env[key] !== undefined) + .reduce((env, key) => { + env[key] = process.env[key] || ''; + return env; + }, {} as Record); + + const ptyProcess = pty.spawn(shell, [], { name: 'xterm-color', cols: 80, rows: 20, cwd: path || process.cwd(), - //env: process.env + env: env }); ptyProcess.onData((data: string) => {