diff --git a/CHANGELOG.md b/CHANGELOG.md index 066bd846..848d554e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Added + +- basic support of `terminal.integrated.env.*`. Limitation: changes of the config are not detected. + ## [4.0.1] - 2021-11-22 ### Changed diff --git a/src/Configurations.ts b/src/Configurations.ts index 25394be5..a2390ab2 100644 --- a/src/Configurations.ts +++ b/src/Configurations.ts @@ -392,7 +392,7 @@ export class Configurations { undefined, undefined, defaultCwd, - undefined, + this.getTerminalIntegratedEnv(), undefined, [], { before: [], beforeEach: [], after: [], afterEach: [] }, @@ -527,7 +527,7 @@ export class Configurations { name, description, cwd, - env, + Object.assign(this.getTerminalIntegratedEnv(), env), envFile, dependsOn, runTask, @@ -591,5 +591,16 @@ export class Configurations { return r; } - //public static readonly PublicKey: string = ''; + private getTerminalIntegratedEnv(): Record { + const config = vscode.workspace.getConfiguration('terminal.integrated.env'); + switch (process.platform) { + case 'darwin': + return config.get('osx') ?? {}; + case 'win32': + return config.get('windows') ?? {}; + case 'linux': + return config.get('linux') ?? {}; + } + return {}; + } } diff --git a/test/cpp/catch2/suite1.cpp b/test/cpp/catch2/suite1.cpp index e25d2082..393db8ed 100644 --- a/test/cpp/catch2/suite1.cpp +++ b/test/cpp/catch2/suite1.cpp @@ -61,3 +61,7 @@ TEST_CASE("throws inside CHECK") { CHECK(throws() == 5); // } + +TEST_CASE("试试中文", "[test]") { + CHECK(true); +} \ No newline at end of file