Skip to content

Remove IsScreenReaderActive() check - #26118

Merged
Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
andyleejordan:remove-screenreader-check
Sep 30, 2025
Merged

Dongbo Wang (daxian-dbw) merged 2 commits into
PowerShell:masterfrom
andyleejordan:remove-screenreader-check

Conversation

@andyleejordan

@andyleejordan Andy Jordan (andyleejordan) commented Sep 29, 2025 •

Copy link
Copy Markdown
Member

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
Copy Markdown
Member Author

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

@andyleejordan
Andy Jordan (andyleejordan) marked this pull request as ready for review September 29, 2025 22:47
@andyleejordan

Andy Jordan (andyleejordan) commented Sep 29, 2025 •

Copy link
Copy Markdown
Member Author

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 Dongbo Wang (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

@iSazonov Ilya (iSazonov) left a comment

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@daxian-dbw Dongbo Wang (daxian-dbw) left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

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

@azure-pipelines

Copy link
Copy Markdown
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

Copy link
Copy Markdown
Member

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

@azure-pipelines

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

@daxian-dbw
Dongbo Wang (daxian-dbw) merged commit 3aa49cc into PowerShell:master Sep 30, 2025
@microsoft-github-policy-service

microsoft-github-policy-service Bot commented Sep 30, 2025 •

Copy link
Copy Markdown
Contributor

📣 Hey @Andy Jordan (@andyleejordan), how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

@andyleejordan
Andy Jordan (andyleejordan) deleted the remove-screenreader-check branch September 30, 2025 20:17
SIRMARGIN pushed a commit to SIRMARGIN/PowerShell that referenced this pull request Dec 12, 2025
Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
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