Skip to content

Commit b0c4153

Browse files
krishnakanumuriandyleejordan
authored andcommitted
Add startLocation setting for Extension Terminal
Can be set to either `Panel` (the default) or `Editor` which opens like a tab (in another "editor" view of VS Code).
1 parent e0e2b20 commit b0c4153

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

package.json

+13
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,19 @@
886886
"default": false,
887887
"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."
888888
},
889+
"powershell.integratedConsole.startLocation": {
890+
"type": "string",
891+
"default": "Panel",
892+
"enum": [
893+
"Editor",
894+
"Panel"
895+
],
896+
"markdownEnumDescriptions": [
897+
"Creates the Extension Terminal in Editor area",
898+
"Creates the Extension Terminal in Panel area"
899+
],
900+
"markdownDescription": "Sets the startup location for Extension Terminal."
901+
},
889902
"powershell.integratedConsole.focusConsoleOnExecute": {
890903
"type": "boolean",
891904
"default": true,

src/process.ts

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export class PowerShellProcess {
107107
iconPath: new vscode.ThemeIcon("terminal-powershell"),
108108
isTransient: true,
109109
hideFromUser: this.sessionSettings.integratedConsole.startInBackground,
110+
location: vscode.TerminalLocation[this.sessionSettings.integratedConsole.startLocation],
110111
};
111112

112113
// Subscribe a log event for when the terminal closes (this fires for

src/session.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ export class SessionManager implements Middleware {
476476
|| settings.developer.bundledModulesPath.toLowerCase() !== this.sessionSettings.developer.bundledModulesPath.toLowerCase()
477477
|| settings.developer.editorServicesWaitForDebugger !== this.sessionSettings.developer.editorServicesWaitForDebugger
478478
|| settings.integratedConsole.useLegacyReadLine !== this.sessionSettings.integratedConsole.useLegacyReadLine
479-
|| settings.integratedConsole.startInBackground !== this.sessionSettings.integratedConsole.startInBackground)) {
479+
|| settings.integratedConsole.startInBackground !== this.sessionSettings.integratedConsole.startInBackground
480+
|| settings.integratedConsole.startLocation !== this.sessionSettings.integratedConsole.startLocation)) {
480481

481482
this.logger.writeVerbose("Settings changed, prompting to restart...");
482483
const response = await vscode.window.showInformationMessage(

src/settings.ts

+6
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ export enum CommentType {
7070
LineComment = "LineComment",
7171
}
7272

73+
export enum StartLocation {
74+
Editor = "Editor",
75+
Panel = "Panel"
76+
}
77+
7378
export type PowerShellAdditionalExePathSettings = Record<string, string>;
7479

7580
class CodeFormattingSettings extends PartialSettings {
@@ -129,6 +134,7 @@ class IntegratedConsoleSettings extends PartialSettings {
129134
useLegacyReadLine = false;
130135
forceClearScrollbackBuffer = false;
131136
suppressStartupBanner = false;
137+
startLocation = StartLocation.Panel;
132138
}
133139

134140
class SideBarSettings extends PartialSettings {

0 commit comments

Comments
 (0)