Skip to content

Fix PSReadline for screen reader#298881

Merged
anthonykim1 merged 11 commits intomainfrom
anthonykim1/psReadlineAccessible
Mar 11, 2026
Merged

Fix PSReadline for screen reader#298881
anthonykim1 merged 11 commits intomainfrom
anthonykim1/psReadlineAccessible

Conversation

@anthonykim1
Copy link
Contributor

@anthonykim1 anthonykim1 commented Mar 3, 2026

Part of: #297146

Problem1:

  • Red error: Import-Module $specialPsrlPath runs without checking if the folder exists. In production builds, the psreadline/ folder isn't there → red error in terminal.
image
  • Unreachable Set-PSReadLineOption -EnableScreenReaderModesince pwsh 7.5+ loaded stripped down version of psreadline 2.3.6. which gave the"WARNING: PowerShell detected that you might be using a screen reader and has disabled PSReadLine as it may not work correctly with your screen reader. If you want to re-enable it, run 'Import-Module PSReadLine'." We need the bundled 2.3.4-beta3 that has theEnableScreenReaderMode` param.

EnableScreenReaderMode is available starting PS ReadLine 2.4.3+ which is more screen reader friendly.
Pre-PR, the code was prevented from setting Set-PSReadLineOption EnableScreenReaderMode

Problem 2: Bundled PSReadLine not shipped in production builds
Symptom: Import-Module threw a red error in production VS Code because the psreadline/ folder didn't exist — it was only present in dev builds??

  • Fix should be editing gulpfiles also adding Test-Path guard to be safer.

Holding off on below until clarification --> #297146 (comment)
Problem 3: CopyRight banner

  • Use -nologo when accessibility mode enabled.

@anthonykim1 anthonykim1 self-assigned this Mar 3, 2026
Copilot AI review requested due to automatic review settings March 3, 2026 06:23
Copy link
Contributor

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.

Pull request overview

Improves PowerShell terminal startup behavior for screen reader users by ensuring a compatible PSReadLine can be loaded/enabled in a11y mode, reducing startup noise, and shipping the bundled PSReadLine assets in production builds.

Changes:

  • Update PowerShell shell integration to prefer importing the bundled PSReadLine (when present), fall back to the system PSReadLine, and enable EnableScreenReaderMode when supported.
  • Inject -nologo into PowerShell launch args when isScreenReaderOptimized is enabled.
  • Include the psreadline/** directory in desktop and server build resource include lists.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
src/vs/workbench/contrib/terminal/common/scripts/shellIntegration.ps1 Adjust PSReadLine import logic in a11y mode and enable screen-reader mode when available.
src/vs/platform/terminal/node/terminalEnvironment.ts Add -nologo when launching PowerShell with screen-reader-optimized mode.
build/gulpfile.vscode.ts Ensure bundled psreadline/** assets are included in desktop build resources.
build/gulpfile.reh.ts Ensure bundled psreadline/** assets are included in server/REH build resources.

@anthonykim1 anthonykim1 requested a review from meganrogge March 4, 2026 18:16
@anthonykim1 anthonykim1 changed the title Fix PSReadline for screen reader, disable noisy CopyRight banner Fix PSReadline for screen reader Mar 4, 2026
@anthonykim1 anthonykim1 marked this pull request as ready for review March 10, 2026 15:34
@vs-code-engineering
Copy link

vs-code-engineering bot commented Mar 10, 2026

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@lszomoru

Matched files:

  • build/azure-pipelines/win32/codesign.ts

@Tyriar

Matched files:

  • src/vs/platform/terminal/node/terminalEnvironment.ts

@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 10, 2026
Copy link
Collaborator

@meganrogge meganrogge left a comment

Choose a reason for hiding this comment

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

Nice!

@anthonykim1 anthonykim1 merged commit a0d3bb6 into main Mar 11, 2026
19 checks passed
@anthonykim1 anthonykim1 deleted the anthonykim1/psReadlineAccessible branch March 11, 2026 02:35
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.

3 participants