Skip to content

Commit 53b9d82

Browse files
committed
PowerShell session commands should activate extension
This change fixes #1020 which states that PowerShell session commands should activate the extension if it isn't already started. These commands are useful for activating a PowerShell session if the user doesn't currently have a PowerShell file open.
1 parent 8f18848 commit 53b9d82

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"onCommand:PowerShell.StartDebugSession",
3333
"onCommand:PowerShell.PickPSHostProcess",
3434
"onCommand:PowerShell.SpecifyScriptArgs",
35-
"onCommand:PowerShell.ShowSessionConsole"
35+
"onCommand:PowerShell.ShowSessionConsole",
36+
"onCommand:PowerShell.ShowSessionMenu",
37+
"onCommand:PowerShell.RestartSession"
3638
],
3739
"dependencies": {
3840
"vscode-languageclient": "3.3.0-alpha.6"

src/session.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -628,14 +628,6 @@ export class SessionManager implements Middleware {
628628
private showSessionMenu() {
629629
var menuItems: SessionMenuItem[] = [];
630630

631-
if (this.sessionStatus === SessionStatus.Initializing ||
632-
this.sessionStatus === SessionStatus.NotStarted ||
633-
this.sessionStatus === SessionStatus.Stopping) {
634-
635-
// Don't show a menu for these states
636-
return;
637-
}
638-
639631
if (this.sessionStatus === SessionStatus.Running) {
640632
menuItems = [
641633
new SessionMenuItem(
@@ -655,7 +647,7 @@ export class SessionManager implements Middleware {
655647
];
656648
}
657649

658-
var currentExePath = this.powerShellExePath.toLowerCase();
650+
var currentExePath = (this.powerShellExePath || "").toLowerCase();
659651
var powerShellItems =
660652
getAvailablePowerShellExes(this.platformDetails)
661653
.filter(item => item.exePath.toLowerCase() !== currentExePath)

0 commit comments

Comments
 (0)