Skip to content

Commit

Permalink
master: support terminal.integrated.env
Browse files Browse the repository at this point in the history
  • Loading branch information
Mate Pek committed Nov 22, 2021
1 parent 9323680 commit 0e8c8e4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions src/Configurations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ export class Configurations {
undefined,
undefined,
defaultCwd,
undefined,
this.getTerminalIntegratedEnv(),
undefined,
[],
{ before: [], beforeEach: [], after: [], afterEach: [] },
Expand Down Expand Up @@ -527,7 +527,7 @@ export class Configurations {
name,
description,
cwd,
env,
Object.assign(this.getTerminalIntegratedEnv(), env),
envFile,
dependsOn,
runTask,
Expand Down Expand Up @@ -591,5 +591,16 @@ export class Configurations {
return r;
}

//public static readonly PublicKey: string = '';
private getTerminalIntegratedEnv(): Record<string, string> {
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 {};
}
}
4 changes: 4 additions & 0 deletions test/cpp/catch2/suite1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ TEST_CASE("throws inside CHECK") {
CHECK(throws() == 5);
//
}

TEST_CASE("试试中文", "[test]") {
CHECK(true);
}

0 comments on commit 0e8c8e4

Please sign in to comment.