Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console geometry in pwsh-7.5.0-preview.2 #21267

Closed
5 tasks done
237dmitry opened this issue Feb 23, 2024 · 7 comments · Fixed by dotnet/runtime#98912
Closed
5 tasks done

Console geometry in pwsh-7.5.0-preview.2 #21267

237dmitry opened this issue Feb 23, 2024 · 7 comments · Fixed by dotnet/runtime#98912
Labels
Resolution-External The issue is caused by external component(s). WG-Interactive-Console the console experience

Comments

@237dmitry
Copy link

237dmitry commented Feb 23, 2024

Prerequisites

Steps to reproduce

80x24 regardless of terminal settings

Expected behavior

The console geometry must match the terminal settings

Actual behavior

80x24

Error details

No errors

Environment data

Name                           Value
----                           -----
PSVersion                      7.5.0-preview.2
PSEdition                      Core
GitCommitId                    7.5.0-preview.2
OS                             ArcoLinux
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

ss

@237dmitry 237dmitry added the Needs-Triage The issue is new and needs to be triaged by a work group. label Feb 23, 2024
@237dmitry
Copy link
Author

Returned on preview.1

@237dmitry 237dmitry changed the title Console geometry in pwsh-7.0.5-preview.2 Console geometry in pwsh-7.5.0-preview.2 Feb 23, 2024
@mklement0
Copy link
Contributor

mklement0 commented Feb 23, 2024

I see the problem on macOS too, but not on Windows.

What changed between preview.1 and preview.2 is the move from .NET 8 to .NET 9 (specifically, .NET SDK version 9.0.100-preview.1.24101.2 and runtime version 9.0.0-preview.1.24080.9).

However, the problem does appear to be on the PowerShell side: when I compile a console application with the same SDK, the correct values are reported.

This bug makes the terminal experience on Unix-like platforms very frustrating.

@microhobby
Copy link

microhobby commented Feb 24, 2024

Same for me on Debian

image

You can note that bash return the right values.

@microhobby
Copy link

microhobby commented Feb 25, 2024

I suppose that the s_terminalHandle is null here:
https://github.com/dotnet/runtime/blob/79dd9bae9bb881eb716b608577c4cedc6c9cba72/src/libraries/System.Console/src/System/ConsolePal.Unix.cs#L360-L361

Then it fallback to the TerminalFormatStringsInstance.Columns and TerminalFormatStringsInstance.Lines:

image

microhobby added a commit to microhobby/runtime that referenced this issue Feb 26, 2024
The terminfo database does not store dynamic information from the
terminal. Instead we should trust in the values read when the
terminal signaled invalidation of the cache.

Fixes: PowerShell/PowerShell#21267

Signed-off-by: Matheus Castello <matheus@castello.eng.br>
adamsitnik pushed a commit to dotnet/runtime that referenced this issue Feb 28, 2024
The terminfo database does not store dynamic information from the
terminal. Instead we should trust in the values read when the
terminal signaled invalidation of the cache.

Fixes: PowerShell/PowerShell#21267

Signed-off-by: Matheus Castello <matheus@castello.eng.br>
@daxian-dbw daxian-dbw added the WG-Interactive-Console the console experience label Mar 14, 2024
@theJasonHelmick theJasonHelmick added Resolution-External The issue is caused by external component(s). and removed Needs-Triage The issue is new and needs to be triaged by a work group. labels Mar 20, 2024
@theJasonHelmick
Copy link
Collaborator

@237dmitry -- Thank you for reporting this issue -- The Interactive WG has reviewed this and we believe that this is being fixed in the current .NET preview (.NET 9 regression).

Copy link
Contributor

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

Copy link
Contributor

microsoft-github-policy-service bot commented Mar 21, 2024

📣 Hey @237dmitry, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-External The issue is caused by external component(s). WG-Interactive-Console the console experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants