PowerShell Console Host – UI Automation – Custom Prompt Accessibility
0 reputation · 31 Aug 2026, 18:49 UTC
0 reputation · 31 Aug 2026, 18:49 UTC
The goal is to ensure that assistive technologies announce the full prompt text when a user types a command in the PowerShell console host. In the legacy Windows Console host, UI Automation exposes the command line buffer as an edit control, but the Name and Value properties omit any custom prompt string. This omission means screen readers such as Narrator only read the raw command, not the prompt that precedes it, creating a gap in context for users who rely on auditory feedback.
Current evidence shows the behavior is consistent across Windows PowerShell 5.1 and PowerShell 7.x, while Windows Terminal correctly includes the prompt in its UI Automation tree. Microsoft’s documentation references UI Automation support but does not clarify whether the prompt should be part of the exposed properties, leaving the implementation status unclear.
Given this uncertainty, what are the expected behaviors for custom prompts in the console host’s UI Automation exposure? Is there an anticipated update to the host that will include prompt text in the automation tree? What interim strategies can developers employ to provide prompt context to screen readers until a definitive fix is released?
34775 reputation · 01 Sept 2026, 06:40 UTC
Confirmed behavior: in the legacy console host (conhost.exe) used by both Windows PowerShell 5.1 and PowerShell 7.x, the UI Automation element for the command line reports only the typed input in its Name and Value properties. A custom prompt string is not part of that element, so Narrator and other UIA-based screen readers announce the command without prompt context. Windows Terminal exposes the prompt together with the input, so it is spoken as part of the same utterance.
| Host | Prompt in UIA tree | Screen reader result |
|---|---|---|
| conhost.exe (legacy) | No | Command only |
| WindowsTerminal.exe | Yes | Prompt plus command |
Not confirmed: no public Microsoft roadmap entry promises prompt text in the legacy host's automation tree. Any change would most plausibly arrive in a Windows servicing update to conhost rather than a PowerShell release, but that is inference, not an announced plan. Plan around the current behavior.
The probable cause is architectural. conhost renders the prompt as ordinary console text outside the editable input region, and the UIA provider it implements models only the active input buffer. Text the user cannot edit is treated as decorative and never surfaces in Name or Value. That is consistent with the same omission appearing in both PowerShell 5.1 and 7.x, since both rely on the same host for console UI. Because Microsoft's documentation does not state whether the prompt belongs in the exposed properties, the current implementation cannot be classified as a documented defect.
System.Management.Automation in a custom console application and implement a UIA provider whose Name is the concatenation of the current prompt and the pending input, refreshed before each read. This adds real engineering cost and can affect performance and compatibility with other console applications, so scope it to a dedicated host rather than a system-wide change.Before committing to a mitigation, confirm what your build actually exposes:
conhost.exe; Windows Terminal sessions run under WindowsTerminal.exe.Name or Value contains the prompt.These behaviors reflect PowerShell 5.1 and 7.x on Windows 10/11 as understood at the time of writing; re-verify on your specific build before shipping anything that depends on them.
Does the custom prompt embed ANSI/VT escape sequences for color? If so, even Windows Terminal or a custom provider may strip or garble them in the automation tree. Test with a plain-text prompt first: if a plain prompt is announced correctly but the colored one is not, simplify the escape sequences or move the prompt onto its own line.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.