Skip to content

Add startLocation setting for Extension Terminal #4639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,19 @@
"default": false,
"markdownDescription": "Starts the Extension Terminal in the background. **If this is enabled, to access the terminal you must run the [Show Extension Terminal command](command:PowerShell.ShowSessionConsole), and once shown it cannot be put back into the background.** This option completely hides the Extension Terminal from the terminals view. You are probably looking for the `#powershell.integratedConsole.showOnStartup#` option instead."
},
"powershell.integratedConsole.startLocation": {
"type": "string",
"default": "Panel",
"enum": [
"Editor",
"Panel"
],
"markdownEnumDescriptions": [
"Creates the Extension Terminal in Editor area",
"Creates the Extension Terminal in Panel area"
],
"markdownDescription": "Sets the startup location for Extension Terminal."
},
"powershell.integratedConsole.focusConsoleOnExecute": {
"type": "boolean",
"default": true,
Expand Down
1 change: 1 addition & 0 deletions src/process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export class PowerShellProcess {
iconPath: new vscode.ThemeIcon("terminal-powershell"),
isTransient: true,
hideFromUser: this.sessionSettings.integratedConsole.startInBackground,
location: vscode.TerminalLocation[this.sessionSettings.integratedConsole.startLocation],
};

// Subscribe a log event for when the terminal closes (this fires for
Expand Down
3 changes: 2 additions & 1 deletion src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ export class SessionManager implements Middleware {
|| settings.developer.bundledModulesPath.toLowerCase() !== this.sessionSettings.developer.bundledModulesPath.toLowerCase()
|| settings.developer.editorServicesWaitForDebugger !== this.sessionSettings.developer.editorServicesWaitForDebugger
|| settings.integratedConsole.useLegacyReadLine !== this.sessionSettings.integratedConsole.useLegacyReadLine
|| settings.integratedConsole.startInBackground !== this.sessionSettings.integratedConsole.startInBackground)) {
|| settings.integratedConsole.startInBackground !== this.sessionSettings.integratedConsole.startInBackground
|| settings.integratedConsole.startLocation !== this.sessionSettings.integratedConsole.startLocation)) {

this.logger.writeVerbose("Settings changed, prompting to restart...");
const response = await vscode.window.showInformationMessage(
Expand Down
6 changes: 6 additions & 0 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export enum CommentType {
LineComment = "LineComment",
}

export enum StartLocation {
Editor = "Editor",
Panel = "Panel"
}

export type PowerShellAdditionalExePathSettings = Record<string, string>;

class CodeFormattingSettings extends PartialSettings {
Expand Down Expand Up @@ -129,6 +134,7 @@ class IntegratedConsoleSettings extends PartialSettings {
useLegacyReadLine = false;
forceClearScrollbackBuffer = false;
suppressStartupBanner = false;
startLocation = StartLocation.Panel;
}

class SideBarSettings extends PartialSettings {
Expand Down