Terminal console lines that are offscreen are missing

Not sure if this is OS, Windows 11, VS, C# or terminal issue. Can't seem to find anything relating this Simple program in C#:
static void Main(string[] args)
{
for(int i = 0; i < 100; i++)
Console.WriteLine("{0}",i);
}
static void Main(string[] args)
{
for(int i = 0; i < 100; i++)
Console.WriteLine("{0}",i);
}
output seems fine until i try seeing earlier values
39 Replies
MartynasXS
MartynasXSOP•3y ago
MartynasXS
MartynasXSOP•3y ago
all the lines before what was seen when program was finished are invisible basically everything outside bounding box of the window
ErickO
ErickO•3y ago
yup they tend to delete it after X number of prints
MartynasXS
MartynasXSOP•3y ago
the lines are blank but they are still scrollable through
ErickO
ErickO•3y ago
👀 interesting what if you try a different emulator, like git bash or something I would guess it's the terminal as opposed to the program unless c# is doing something else behind the scenes that I don't know it shouldn't really have control over what it prints, that code just gets converted to asm with a call to sys to print the numbers
MartynasXS
MartynasXSOP•3y ago
i wonder if its windows terminal thing altogether
Jochem
Jochem•3y ago
try powershell cause that code's valid
ErickO
ErickO•3y ago
yup
MartynasXS
MartynasXSOP•3y ago
trying to find how to change it in vs community it still opens cmd in windows terminal 💀 vscode is too popular all the answers are for it
ErickO
ErickO•3y ago
wtf is vs community oh the IDE?
MartynasXS
MartynasXSOP•3y ago
yes
ErickO
ErickO•3y ago
ah
Jochem
Jochem•3y ago
I guarantee it's just the console being wonky though add
using System.Threading;
using System.Threading;
to the top and add this after your console.writeline inside the for statement
Thread.Sleep(100);
Thread.Sleep(100);
it'll wait 0.1s between printing lines, and then you can see them scroll past
ErickO
ErickO•3y ago
the capitalization of C# stuff bothers me for some reason
Jochem
Jochem•3y ago
it's pretty consistent, Classes and Methods are capitalized
MartynasXS
MartynasXSOP•3y ago
yeah ok so that makes it all appear
ErickO
ErickO•3y ago
more about...the way it is than consistency I just dislike it a bit
Jochem
Jochem•3y ago
so 100% it's a console issue and you don't really have to worry about it if you don't want to 🙂
ErickO
ErickO•3y ago
yeh figured it was console issue
Jochem
Jochem•3y ago
yeah, I can see that. It took some getting used to
ErickO
ErickO•3y ago
just use linux mate 😎
MartynasXS
MartynasXSOP•3y ago
yeah i know its console issue but its difficult to debug if you log out more than 20 values and half the lines are gone
Jochem
Jochem•3y ago
hm, fair what's under that down pointing arrow? can you change the console to powershell there? what if you rightclick the +?
MartynasXS
MartynasXSOP•3y ago
i can change it there but the code has already been ran in cmd and it opens a new cmd window every time code is ran and it would just open another empty terminal if i did choose powershell there ill try asking in c# discord
Jochem
Jochem•3y ago
ok, good luck!
MartynasXS
MartynasXSOP•3y ago
Its probably more related to Visual studio than webdev thanks for the help anyways. okay so apparently i have to set it on system level rather than in the IDE
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
9001 @charlesroper and as i said i can scroll up for all the missing lines they just appear blank
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
same on all projects and yeah i changed to windows console host and it works lemme see the rendering settings dont have atlas renderer and every other setting didnt change anything
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
yeah its reoccurring maybe im outdated what is your terminal version? 1.15.2875.0 here
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
hmm okay
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
yeah others dont seem to have this issue mostly because not using visual studio atleast here
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
MartynasXS
MartynasXSOP•3y ago
yeah i will once im free thanks for the help
Unknown User
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server