Skip to content

Enable the command history and token variables #227

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 1 commit into from
Mar 3, 2020

Conversation

daxian-dbw
Copy link
Contributor

Fix #142

The PR contains 2 major changes:

  • Clean up CancellationTokenSource defined in the PowerShell kernel, and use context.CancellationToken instead.
  • Pass in PSInvocationSettings when invoking PowerShell commands, so as to enable command history and token variables.

@@ -148,7 +138,7 @@ public override bool TryGetVariable(string name, out object value)
return Task.CompletedTask;
}

if (cancellationSource.IsCancellationRequested)
if (context.CancellationToken.IsCancellationRequested)
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this get canceled when the user hits stop in the Jupyter GUI?

If so, I'd like to see this cancel the PowerShell execution if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonsequitur made the change to lift up the support to cancel an operation, but it's not entirely wired up yet (take a look at that property in KernelInvocationContext). I will submit a separate PR to cancel PowerShell execution when it's wired up.

Copy link
Contributor

@TylerLeonhardt TylerLeonhardt left a comment

Choose a reason for hiding this comment

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

LGTM

@jonsequitur jonsequitur merged commit 30a2aad into dotnet:master Mar 3, 2020
@daxian-dbw daxian-dbw deleted the dollar-dollar branch March 3, 2020 22:00
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.

$$ automatic variable not set in PowerShell
3 participants