Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonykim1 committed Oct 30, 2024
1 parent eaaf338 commit de99824
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions src/client/common/terminal/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,28 +144,14 @@ export class TerminalService implements ITerminalService, Disposable {
}
// TODO: Debt switch to Promise<Terminal> ---> breaks 20 tests
public async ensureTerminal(preserveFocus: boolean = true): Promise<void> {
let createTerminalOptions: TerminalOptions;
const uri = getActiveResource();
const configuration = getConfiguration('python', uri);
const pythonStartupSetting = configuration.get<boolean>('terminal.shellIntegration.enabled', false);

if (pythonStartupSetting) {
createTerminalOptions = {
name: this.options?.title || 'Python',
env: { PYTHONSTARTUP: this.envVarScript },
hideFromUser: this.options?.hideFromUser,
};
} else {
createTerminalOptions = {
name: this.options?.title || 'Python',
hideFromUser: this.options?.hideFromUser,
};
}
if (this.terminal) {
return;
}
this.terminalShellType = this.terminalHelper.identifyTerminalShell(this.terminal);
this.terminal = this.terminalManager.createTerminal(createTerminalOptions);
this.terminal = this.terminalManager.createTerminal({
name: this.options?.title || 'Python',
hideFromUser: this.options?.hideFromUser,
});
this.terminalAutoActivator.disableAutoActivation(this.terminal);

// Sometimes the terminal takes some time to start up before it can start accepting input.
Expand Down

0 comments on commit de99824

Please sign in to comment.