-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
C# Console CursorTop is not calculated as same as native windows cmd #10063
Comments
it should if cursortop ==0 reflow only enters in action if you print WindowWidth+1 [1], if you print only windowWidth the cursor will remain in the same line, and if that line is 0, you will try to decrement it, which will result in -1 which is not a valid line number hence the error. [1]: if console reflow is actually enabled that is |
@LuanVSO I tested in cmd and powershell (their own window) and after printing space in count of |
ok so, for me if i print |
This is probably because Windows Terminal has |
Yep, James has the right of it here. For an application that relies on specific console modes being set (sorry- line wrapping behavior unfortunately requires specific modes) our recommendation is that it set those modes on startup. |
OH, And there's a great discussion about this in /dup #8312 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Windows Terminal version (or Windows build number)
Windows10 - 20H2 - 19042.964
Other Software
No response
Steps to reproduce
.\ConsoleApp.exe
Expected Behavior
it should fill the current line with white space and then because the white spaces count is equal to windows width, after the last white space the cursor should move to next line
then by setting cursor top to
cursor top - 1
it shouldn't throw any exception.I tested this in
cmd
andpowershell
and there was no problem.Actual Behavior
after last white space cursor doesn't go to next line so it throws exception.

The text was updated successfully, but these errors were encountered: