Skip to content

Restart Current Session in every session quick pick #1616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 28, 2018

Conversation

TylerLeonhardt
Copy link
Member

PR Summary

fixes #1614

This does some reorganizing of the quick pick dialog for sessions. It makes sure the Restart Current Session command is always available and only shows the Switch to X when a session is running.

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just one request

Copy link
Contributor

@rjmholt rjmholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

const currentExePath = (this.powerShellExePath || "").toLowerCase();
const availablePowerShellExes =
getAvailablePowerShellExes(this.platformDetails, this.sessionSettings);

let sessionText: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this.sessionStatus is not SessionStatus.Running or SessionStatus.Failed, will this remain undefined? What will be shown in the menu?

If we're just branching on different values of an enum, maybe a switch block would be clearer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exhaustive switch statements FTW 👍 updated to a switch.

Copy link
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rjmholt rjmholt merged commit f97ee10 into PowerShell:master Nov 28, 2018
@TylerLeonhardt TylerLeonhardt deleted the restart-session branch August 10, 2020 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No option to restart session in some instances
4 participants