UI width, possibly word wrap, in PowerShell Integrated console is causing an input error while debugging
See original GitHub issuePrerequisites
- I have written a descriptive issue title.
- I have searched all issues to ensure it has not already been reported.
- I have read the troubleshooting guide.
- I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
Summary
I have a PowerShell script that prompts a user input via Read-Host command. I reduced the width of the PowerShell integrated console terminal just right at the edge of the prompt and it returns error. however, by widening the UI width fixes the issue.
Please see below for the error:
Do you also want to generate FULL PERMS html reports from the Delegation dataset? (y/n):y (<-- my input would sit very edge of the terminal UI) Read-Host Prompt failed, check inner exception for details At \execweb\Toolbox\frhwang\0NetworkRepo\ExecMailboxAudit-onPrem\Start-ESSMailboxAudit. ps1:71 char:18
- … nSection5 = Read-Host -Prompt "Do you also want to generate FULL PERM …
-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (😃 [Read-Host], Exception
- FullyQualifiedErrorId : System.Exception,Microsoft.PowerShell.Commands.ReadHostCo mmand
PowerShell Version
$PSVersionTable
Name Value
---- -----
PSVersion 5.1.19041.1237
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.19041.1237
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Visual Studio Code Version
code --version
1.60.2
7f6ab5485bbc008386c4386d08766667e155244e
x64
Extension Version
code --list-extensions --show-versions | Select-String powershell
ms-vscode.powershell@2021.9.2
Steps to Reproduce
- while in debugging, invoke a read-host prompt with some prompt sentence and have the input cursor sit at the very last line of the available width of the terminal. (if cursor warp to the next line, invoke it again)
- type something as an input. it will trigger the read-host prompt failed error.
- you can immediately remedy this by widening the UI or shortening it for the prompt to warp to the next line.
I can reproduce this at will. please contact me if you have a hard time reproducing it.
Visuals
Logs
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Word Wrap STILL Not Working on PowerShell Integrated ...
I have observed the following: Fill the console with characters up to 99%; As one tries to type the next character, the following...
Read more >User and Workspace Settings - Visual Studio Code
on : Lines will wrap at the viewport width. // - inherit: Lines will wrap according to the `editor.wordWrap` setting. "diffEditor.wordWrap": "inherit" ...
Read more >All other Tokyo fixes - Product Documentation | ServiceNow
In the compose section, the text input in 'Comments' isn't hidden when setting the action from 'visible' to 'false' using the UI policy....
Read more >Automate Desktop and Automate Plus/Ultimate - Fortra
The HTTP action's "Authentication type" parameter now displays all available types, based on the HTTP activity being used. The PowerShell action no longer ......
Read more >Integration Services Error and Message Reference
Hexadecimal code Decimal Code Symbolic Name
0x8002F347 ‑2147290297 DTS_E_STOREDPROCSTASK_OVERWRITINGSPATD...
0x8020837E ‑2145352834 DTS_E_ADOSRCUNKNOWNTYPEMAPPEDTONTEXT
0x8020838C ‑2145352820 DTS_E_XMLSRCSCHEMACOLUMNNOTINEXTERNAL...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah the following will help us to reproduce the issue:
Read-Host
part of the script with the full prompt[console]::windowwidth
gmo PSReadLine
andgcm PSConsoleHostReadLine
so dragging UI has to happen. I had to drag between 73 and 72 in micro movement to repro this. If there is a value that tracks in smaller increments than whole numbers, please let me know. maybe recording screen would be a better option here.