Skip to content

Commit

Permalink
test get shellIntegration env
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Jan 7, 2025
1 parent ef6ca9f commit 43b3f5d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/client/common/terminal/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,14 @@ export class TerminalService implements ITerminalService, Disposable {
if (!terminal.shellIntegration && this._terminalFirstLaunched) {
this._terminalFirstLaunched = false;
const promise = new Promise<boolean>((resolve) => {
const disposable = this.terminalManager.onDidChangeTerminalShellIntegration(() => {
const disposable = this.terminalManager.onDidChangeTerminalShellIntegration((e) => {
clearTimeout(timer);
disposable.dispose();
resolve(true);
const shellIntegration = (terminal.shellIntegration as unknown) as { env: any };
const tempEnv = shellIntegration.env;
console.log(tempEnv);
traceVerbose('Printing temp env from service.ts in terminal1');
});
const TIMEOUT_DURATION = 500;
const timer = setTimeout(() => {
Expand All @@ -114,6 +118,11 @@ export class TerminalService implements ITerminalService, Disposable {
return undefined;
} else if (terminal.shellIntegration) {
const execution = terminal.shellIntegration.executeCommand(commandLine);

const shellIntegration = (terminal.shellIntegration as unknown) as { env: any };
const tempEnv = shellIntegration.env;
console.log(tempEnv);
traceVerbose('Printing temp env from service.ts in terminal2');
traceVerbose(`Shell Integration is enabled, executeCommand: ${commandLine}`);
return execution;
} else {
Expand Down

0 comments on commit 43b3f5d

Please sign in to comment.