Skip to content

Commit

Permalink
PowerShell session commands should activate extension
Browse files Browse the repository at this point in the history
This change fixes PowerShell#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.
  • Loading branch information
daviwil committed Sep 5, 2017
1 parent e103f93 commit 6e3b179
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
"onCommand:PowerShell.StartDebugSession",
"onCommand:PowerShell.PickPSHostProcess",
"onCommand:PowerShell.SpecifyScriptArgs",
"onCommand:PowerShell.ShowSessionConsole"
"onCommand:PowerShell.ShowSessionConsole",
"onCommand:PowerShell.ShowSessionMenu",
"onCommand:PowerShell.RestartSession"
],
"dependencies": {
"vscode-languageclient": "3.3.0-alpha.6"
Expand Down
10 changes: 1 addition & 9 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,14 +628,6 @@ export class SessionManager implements Middleware {
private showSessionMenu() {
var menuItems: SessionMenuItem[] = [];

if (this.sessionStatus === SessionStatus.Initializing ||
this.sessionStatus === SessionStatus.NotStarted ||
this.sessionStatus === SessionStatus.Stopping) {

// Don't show a menu for these states
return;
}

if (this.sessionStatus === SessionStatus.Running) {
menuItems = [
new SessionMenuItem(
Expand All @@ -655,7 +647,7 @@ export class SessionManager implements Middleware {
];
}

var currentExePath = this.powerShellExePath.toLowerCase();
var currentExePath = (this.powerShellExePath || "").toLowerCase();
var powerShellItems =
getAvailablePowerShellExes(this.platformDetails)
.filter(item => item.exePath.toLowerCase() !== currentExePath)
Expand Down

0 comments on commit 6e3b179

Please sign in to comment.