ant-druha / intellij-powershell

Adds PowerShell language support to IntelliJ-based IDEs.
https://plugins.jetbrains.com/plugin/10249-powershell
Apache License 2.0
73 stars 20 forks source link

Console output forcibly wraps output to 80 characters #172

Closed grzegorz-wolszczak closed 10 months ago

grzegorz-wolszczak commented 11 months ago

After powershell plugin update to version 2.3.0 (from 2.0.10). while trying to execute powrshell script with content like (one long line)

Write-Host "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum sed faucibus urna. Curabitur tincidunt vitae turpis eu mattis. Vestibulum nec euismod tortor, ut dictum augue. Duis a imperdiet ipsum. Maecenas gravida justo vel convallis vehicula. Donec nec turpis et massa porttitor aliquet vitae malesuada mi. Ut sit amet lacus tincidunt, facilisis nisi ut, ornare felis. Maecenas vitae lectus ut tellus ullamcorper accumsan ut ac sem. In neque quam, lobortis cursus aliquam id, rutrum ut neque. Proin lacinia interdum purus, a porta sapien. Mauris tincidunt sagittis commodo. Quisque rhoncus sollicitudin sagittis. Nunc euismod quam eget facilisis accumsan. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam ut purus fringilla, hendrerit quam non, aliquam risus."

console ouput is wrapped .e.g

rider_colsole_wraps_code_issue

ForNeVeR commented 11 months ago

Thanks for report.

I almost surely know what caused this issue (migrating from stdout-based terminal processor to the PTY-based), but I'll need to perform some experiments to decide what to do next.

Actually, we expect much better experience from PTY (and there were some features to specifically prevent this particular issue in ConPTY on Windows from appearing), but if there's no other way, then I'll consider adding an option to roll back to the previous behavior.

ForNeVeR commented 11 months ago

So far, I've reproduced the issue and I see that something weird's going on. We always seem to use winpty (an older library) instead of ConPTY. I never seen this before, didn't know it's even possible. Will investigate further.

jeremy-morren commented 11 months ago

I was able to solve this by adding [Console]::BufferWidth = 32766 at the start of the script.