From 74b4e76d441f4e17ed20e4f122d4a44513560bc7 Mon Sep 17 00:00:00 2001 From: Catherine Date: Mon, 7 Oct 2024 22:47:09 +0000 Subject: [PATCH] Allow configuring working directory and environment of launched process. --- package.json | 8 ++++++++ src/debugger.ts | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f5943c..b8b6ec7 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,14 @@ "default": "${workspaceFolder}", "description": "Specifies the working directory for the launch command." }, + "rtlDebugger.env": { + "type": "object", + "patternProperties": { + "": "string" + }, + "default": {}, + "description": "Specifies the environment for the launch command." + }, "rtlDebugger.port": { "type": "integer", "minimum": 1, diff --git a/src/debugger.ts b/src/debugger.ts index 2982279..ce36d0f 100644 --- a/src/debugger.ts +++ b/src/debugger.ts @@ -91,9 +91,11 @@ export class CXXRTLDebugger { const configuration = vscode.workspace.getConfiguration('rtlDebugger'); if (configuration.command.length !== 0) { this.terminal = vscode.window.createTerminal({ - name: "CXXRTL Simulation", + name: 'Simulation Process', shellPath: configuration.command[0], shellArgs: configuration.command.slice(1), + cwd: configuration.cwd, + env: configuration.env, isTransient: true, iconPath: new vscode.ThemeIcon('debug-console') });