Skip to content

Commit

Permalink
Add startLocation setting for Extension Terminal
Browse files Browse the repository at this point in the history
Can be set to either `Panel` (the default) or `Editor` which opens like
a tab (in another "editor" view of VS Code).
  • Loading branch information
Krishna Kanumuri authored and andyleejordan committed Jun 27, 2023
1 parent e0e2b20 commit b0c4153
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
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

0 comments on commit b0c4153

Please sign in to comment.