Skip to content
← Back to Community
Java and C# Console window height has changed and is inconsistent
Profile icon
hacker
has Hacker Plan
MrLane

I have written a text based game engine in Java (then ported it to C#) that essentially turns the Console window into graphical canvas.

And up until recently the Console window in both languages could be drawn at a "resolution" of 120x50

Then about a month and half ago something changed on the repl side for the C# Console. The window was getting cut off in both directions. I had to modify my maximum screen resolution down to 80x24

The Java window was still the original resolution, until last night. A bunch of my students noticed their normally 120x50 window was getting cut off vertically. And what I found was that it too somehow got locked to a max height of 24.

But this is inconsistent, some students were able to get the full canvas size by changing their screen resolution and reloading repl.it. I attempted this fix, but it did nothing for me.

Has anyone seen anything like this or know why/how it happens and a solution or workaround?

Thank you for your time.

Voters
Profile icon
ThatIsOffensive
Profile icon
auvgy
Profile icon
WILLIAMBAEWER
Profile icon
MrLane
Comments
hotnewtop
Profile icon
SixBeeps

That's the reason we have Console.WindowWidth, Console.WindowHeight, Console.BufferWidth, and Console.BufferHeight in C# :)

Profile icon
MrLane

@SixBeeps
Agreed, but this does not explain the sudden change. Even if I do use these functions to dynamically determine and set the resolution, my grade 10 students will be flabbergasted when their code visually looked one way on one day then completely different the next with no code changes. Not ideal.

Profile icon
SixBeeps

@MrLane
Actually, now that I'm re-reading your original post, this sounds like something I found not too long ago. I had planned on making a ticket about it, but Cookie and I hadn't found any consistency with our findings.

Profile icon
MrLane

@SixBeeps
My thoughts are that somehow behind the scenes it is being set by either screen resolution or window size because I have seen the results change in both scenarios. It's interesting that it did not start happening for my C# engine until November and then Java today.

Profile icon
SixBeeps

@MrLane
Either that, or there's some Xterm config in the Polygott image that's setting a max resolution for some reason. Either way, it's still weird that it happened to both of them at different times, because they both have been running the same Polygott image for some time now.

Profile icon
RYANTADIPARTHI

i don't think there is a workaround. Its just like that. The console. It's height is inconsistent. But you could report to feedback to fix it, or bugs. if you have a problem.

Profile icon
MrLane

@RYANTADIPARTHI

Thank you, I did just that. We will see if anything comes of it.

Profile icon
RYANTADIPARTHI

@MrLane
no problem.