KEMBAR78
Remove `IsScreenReaderActive()` check by andyleejordan · Pull Request #26118 · PowerShell/PowerShell · GitHub
Skip to content

Conversation

@andyleejordan
Copy link
Member

@andyleejordan andyleejordan commented Sep 29, 2025

PR Summary

With the upcoming inclusion of PSReadLine 2.4, screen readers are now properly supported so we can stop avoiding the loading of PSReadLine. Essentially reverses #10385.

PR Context

Given the new screen reader support from PowerShell/PSReadLine#4854 included in PSReadLine 2.4, and that we are planning to include that beta in the next PowerShell 7.6 preview (with a 2.4 GA to be included in 7.6 RC), we can remove this workaround that avoided loading PSReadLine when screen readers were detected.

The same SPI check is performed in PSReadLine to enable screen reader mode, so the default user experience should switch from no PSReadLine (and a fairly broken legacy REPL implementation) to PSReadLine 2.4 in screen reader mode with known, improved support. There is a small known edge case where a user-installed older version of PSReadLine may be unexpectedly loaded where it was previously not being loaded, but the workaround is to update or remove the user-install. The other known potential issue is that we are changing the default screen reader experience. We believe the move is an improvement, and it is currently in real-world use in VS Code. But if there is a bug that requires the previous behavior, the user can Remove-Module PSReadLine to workaround it, and if we find we need to revert this change, it is very small.

PR Checklist

@andyleejordan
Copy link
Member Author

I'm unsure what labels are appropriate for this PR.

@andyleejordan andyleejordan force-pushed the remove-screenreader-check branch from 0065a7c to a816ace Compare September 29, 2025 21:30
@andyleejordan andyleejordan marked this pull request as ready for review September 29, 2025 22:47
@andyleejordan
Copy link
Member Author

andyleejordan commented Sep 29, 2025

Marking as ready to review because the three failures are unrelated, confirmed by seeing the same three tests fail in https://github.com/PowerShell/PowerShell/actions/runs/18079717180/job/51471840175 for #26109

GitHub
PowerShell for every system! Contribute to PowerShell/PowerShell development by creating an account on GitHub.

@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 Sep 29, 2025
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.

If there is a risk of regression why not implement this as an experimental feature so that users could turn off this until fix will be prepared?

consoleRunspace = null;
psReadlineFailed = true;
}
consoleRunspace = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder why don't we dispose the runspace?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's a question I don't have an answer to.

@andyleejordan
Copy link
Member Author

If there is a risk of regression why not implement this as an experimental feature so that users could turn off this until fix will be prepared?

We don't believe the risk is high enough to justify going through extra process beyond getting this into the preview and release candidates.

Copy link
Member

@daxian-dbw daxian-dbw left a comment

Choose a reason for hiding this comment

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

LGTM

@daxian-dbw
Copy link
Member

/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

With the upcoming inclusion of PSReadLine 2.4,
screen readers are now properly supported.
@daxian-dbw daxian-dbw force-pushed the remove-screenreader-check branch from ea3dad9 to 842f8b3 Compare September 30, 2025 18:47
@daxian-dbw
Copy link
Member

/azp run PowerShell-CI-linux-packaging, PowerShell-Windows-Packaging-CI

@azure-pipelines
Copy link

Azure Pipelines could not run because the pipeline triggers exclude this branch/path.

@daxian-dbw daxian-dbw merged commit 3aa49cc into PowerShell:master Sep 30, 2025
36 checks passed
@microsoft-github-policy-service
Copy link
Contributor

microsoft-github-policy-service bot commented Sep 30, 2025

📣 Hey @@andyleejordan, 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.

3 participants