Skip to content

Never load a module targeting the PSReadLine module's SessionState #24909

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 2 commits into from
Feb 18, 2025

Conversation

daxian-dbw
Copy link
Member

PR Summary

Fix #24904

Module loading could happen in PSReadLine module's context because

  1. it may be due to tab completion triggered by PSReadLine,
  2. it may be due to a command run triggered by key-binding press

But that doesn't mean the module should be loaded targeting the PSReadLine module's session state. In this case, we should use the Global session state instead. PSReadLine doesn't depend on any other modules and should not have any module loaded into its session state.

PR Checklist

@daxian-dbw daxian-dbw requested a review from Copilot January 31, 2025 18:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

@daxian-dbw daxian-dbw added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Jan 31, 2025
@daxian-dbw
Copy link
Member Author

/azp run

Copy link

Azure Pipelines successfully started running 4 pipeline(s).

Copy link
Collaborator

@iSazonov iSazonov left a comment

Choose a reason for hiding this comment

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

LGTM with one minor comment.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Review - Needed The PR is being reviewed label Feb 8, 2025
@iSazonov

This comment was marked as duplicate.

This comment was marked as outdated.

@microsoft-github-policy-service microsoft-github-policy-service bot removed the Review - Needed The PR is being reviewed label Feb 14, 2025
@daxian-dbw daxian-dbw merged commit 1b03005 into PowerShell:master Feb 18, 2025
39 of 41 checks passed
@daxian-dbw daxian-dbw deleted the psrl branch February 18, 2025 18:18
Copy link
Contributor

microsoft-github-policy-service bot commented Feb 18, 2025

📣 Hey @daxian-dbw, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log
Projects
None yet
Development

Successfully merging this pull request may close these issues.

StackOverflowException when PSReadLine is imported inside another imported module
2 participants