Skip to content

Commit 78bbb83

Browse files
authored
Add buttons for moving the terminal around. (#2704)
* Add buttons for moving the terminal around. * Add button visibility options. * Simplified button visibility options.
1 parent 252a2c5 commit 78bbb83

9 files changed

+126
-2
lines changed

package.json

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,33 @@
265265
"command": "PowerShell.InvokeRegisteredEditorCommand",
266266
"title": "Invoke Registered Editor Command",
267267
"category": "PowerShell"
268+
},
269+
{
270+
"command": "workbench.action.closePanel",
271+
"title": "Close panel",
272+
"category": "PowerShell",
273+
"icon": {
274+
"light": "resources/light/ClosePanel.svg",
275+
"dark": "resources/dark/ClosePanel.svg"
276+
}
277+
},
278+
{
279+
"command": "workbench.action.positionPanelLeft",
280+
"title": "Move panel left",
281+
"category": "PowerShell",
282+
"icon": {
283+
"light": "resources/light/MovePanelLeft.svg",
284+
"dark": "resources/dark/MovePanelLeft.svg"
285+
}
286+
},
287+
{
288+
"command": "workbench.action.positionPanelBottom",
289+
"title": "Move panel to bottom",
290+
"category": "PowerShell",
291+
"icon": {
292+
"light": "resources/light/MovePanelBottom.svg",
293+
"dark": "resources/dark/MovePanelBottom.svg"
294+
}
268295
}
269296
],
270297
"menus": {
@@ -306,12 +333,27 @@
306333
],
307334
"editor/title": [
308335
{
309-
"when": "editorLangId == powershell",
336+
"when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons",
337+
"command": "workbench.action.positionPanelBottom",
338+
"group": "navigation@97"
339+
},
340+
{
341+
"when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons",
342+
"command": "workbench.action.positionPanelLeft",
343+
"group": "navigation@98"
344+
},
345+
{
346+
"when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons",
347+
"command": "workbench.action.closePanel",
348+
"group": "navigation@99"
349+
},
350+
{
351+
"when": "editorLangId == powershell && config.powershell.buttons.showRunButtons",
310352
"command": "workbench.action.debug.start",
311353
"group": "navigation@100"
312354
},
313355
{
314-
"when": "editorLangId == powershell",
356+
"when": "editorLangId == powershell && config.powershell.buttons.showRunButtons",
315357
"command": "PowerShell.RunSelection",
316358
"group": "navigation@101"
317359
}
@@ -800,6 +842,16 @@
800842
],
801843
"default": "Diagnostic",
802844
"description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more."
845+
},
846+
"powershell.buttons.showRunButtons": {
847+
"type": "boolean",
848+
"default": true,
849+
"description": "Show the Run and Run Selection buttons in the editor titlebar."
850+
},
851+
"powershell.buttons.showPanelMovementButtons": {
852+
"type": "boolean",
853+
"default": false,
854+
"description": "Show buttons in the editor titlebar for moving the panel around."
803855
}
804856
}
805857
},

resources/dark/ClosePanel.svg

Lines changed: 9 additions & 0 deletions
Loading

resources/dark/MovePanelBottom.svg

Lines changed: 10 additions & 0 deletions
Loading

resources/dark/MovePanelLeft.svg

Lines changed: 10 additions & 0 deletions
Loading

resources/light/ClosePanel.svg

Lines changed: 9 additions & 0 deletions
Loading

resources/light/MovePanelBottom.svg

Lines changed: 10 additions & 0 deletions
Loading

resources/light/MovePanelLeft.svg

Lines changed: 10 additions & 0 deletions
Loading

src/features/ISECompatibility.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ export class ISECompatibilityFeature implements IFeature {
2424
{ path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false },
2525
{ path: "files", name: "defaultLanguage", value: "powershell" },
2626
{ path: "workbench", name: "colorTheme", value: "PowerShell ISE" },
27+
{ path: "powershell.buttons", name: "showPanelMovementButtons", value: true }
2728
];
2829
private iseCommandRegistration: vscode.Disposable;
2930
private defaultCommandRegistration: vscode.Disposable;

src/settings.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export interface ISettings {
100100
bugReporting?: IBugReportingSettings;
101101
sideBar?: ISideBarSettings;
102102
pester?: IPesterSettings;
103+
buttons?: IButtonSettings;
103104
}
104105

105106
export interface IStartAsLoginShellSettings {
@@ -125,6 +126,11 @@ export interface IPesterSettings {
125126
debugOutputVerbosity?: string;
126127
}
127128

129+
export interface IButtonSettings {
130+
showRunButtons?: boolean;
131+
showPanelMovementButtons?: boolean;
132+
}
133+
128134
export function load(): ISettings {
129135
const configuration: vscode.WorkspaceConfiguration =
130136
vscode.workspace.getConfiguration(
@@ -192,6 +198,11 @@ export function load(): ISettings {
192198
CommandExplorerVisibility: true,
193199
};
194200

201+
const defaultButtonSettings: IButtonSettings = {
202+
showRunButtons: true,
203+
showPanelMovementButtons: false
204+
};
205+
195206
const defaultPesterSettings: IPesterSettings = {
196207
useLegacyCodeLens: true,
197208
outputVerbosity: "FromPreference",
@@ -237,6 +248,8 @@ export function load(): ISettings {
237248
configuration.get<ISideBarSettings>("sideBar", defaultSideBarSettings),
238249
pester:
239250
configuration.get<IPesterSettings>("pester", defaultPesterSettings),
251+
buttons:
252+
configuration.get<IButtonSettings>("buttons", defaultButtonSettings),
240253
startAsLoginShell:
241254
// tslint:disable-next-line
242255
// We follow the same convention as VS Code - https://github.com/microsoft/vscode/blob/ff00badd955d6cfcb8eab5f25f3edc86b762f49f/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L105-L107

0 commit comments

Comments
 (0)