68 Replies
It kinda looks like old output? Like a Windows Terminal Buffering error
Old output being overwritten with new output
its oldouput with new output, i was thinking it to be a buffering issue but ive found no workarounds
I've tried clearing console almost everywhere n it doe nothings
I get that issue all the time with random apps (e.g
npm i
, wget
, ...)so how does one resolve it
sadly never quite figured out how it happens or how to solve it :/
oof sad
it only happens on Windows too, never had it happen in Linux or MacOS
bruh
i know its 100% that method, it cos i go in and out of it via a menu n it shows the old with the new
Not all terminals support the clear command
What terminal are you using?
and what to do is: try another one
the default one VS uses then tried powershell n still same thing
also it clears anything else i want but in that method specifically it doesnt
oh
or that part in the method rather
if that's the case then you need to track down yourself what prevents it from clearing in that method
try removing parts of your method until it clears it
I've tried n tried for past hour or so
and? what have you come down to so far
that nothing I do make its clear
even when its logically supposed to clear it doesnt
you said your other methods work
yes
this specific section of my code doesnt want to clear
then you need to find the difference between this method and others
what prevents it from clearing
if it was that easy i would of figured it out
To achieve that, you need to remove parts of the method until it works
once it works you know that the last bit you removed prevented it from working
so you can look deeper into it
realistically, the only thing I can think of is try removing
Console.ReadKey()
Ive added and removed tons of things, i was thinking maybe its deeper than that n looked elswhere but it dont seem to budge
if you've already performed this procedure you can tell what prevents it from clearing
becuase it displays info the read key should be there
its literally not possible xD
I think you're still not understanding
To fix a problem you first need to find it
In order to find the problem you need to perform this procedure of debugging, in particular what I suggest is removing parts of code until it works and see what was causing the problem
Once you know what the problem is, you revert the changes, and think how you can fix it
The issue is, I know where the issue is happening its just a matter of why
I've debugged too btw
and where does it happen? Which exact line in your code prevents Console.Clear from working properly?
after the code is finished it seems to stay persistant even if i include a console clear at the end
so when leaving the method i provided the console doesnt clear for some reason
You didn't answer the question
it could be the readkey but that is needed to wait for user input to see if theyre done reading
after the readkey i the issue it dont clear console
it doesnt recognise these as lines or something
does no one know how to fix thi
s
@jcotton42 Mr pro ❤️
?
Theres this weird issue im having where the console doesnt clear n maintains throughout the lifetime of the console, the method i have is above
Well, it seems someone was already helping, so.
they dissapeared and everyone here who tried to help cant figure it out, so.
Put a break point on the Clear line. Show us that it's hitting that break point. Then step over it and show the result on the console
this is before i step over
this is after
makes no sense at all what its printing
What do you mean what it's printing doesn't make sense?
Did you do a single step over like I asked?
ive done it plenty of times, ive showed u what happened after debug
Seat 25G (economy): Available
Seat 26A (economy): Available
Seat 26B (economy): Available
Welcome to Metropolitan Airlines
it still hangs up on the console
Doing a single step over should not be able to print anything
You must have done it incorrectly
exactly yet it still displays
It cannot
It is impossible
u can go in vc so i can share screen
No
nothing is impossible
Yes. This is impossible.
Well its happening
Lemme see if i can get a vid of it
It cannot. I'm telling you it cannot happen. A single step over would halt at the end of the method and would not reach any further writelines. It cannot print anything
$debug
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
ehh
It's a bit too much info for just this case, but still a useful read
07.11.2024_21.10.42_REC
Recorded with ScreenRec
look
Would you please do what I asked?
Set a breakpoint on the Clear that's giving you problems. Show that it's hitting the break point. Then step over ONCE, show that you did so, and then show the console. Do not continue the app.
did i not show u that here @ero
You showed that it's hitting the breakpoint. You did not show that you stepped over.
this is the step over.
I cannot verify that
Im telling you it is
the only line that gets cleared is the please"
No need to leave, just say you got proven wrong. 😛 @ero
You do not want to cooperate. I don't feel like helping.
This is how you lose help.
no its not. i did as he asked ne he jut quit
when he was proved wrong and i show him his "impossible" was possible he gave up
i cooperated and you had no soultion
I done everything anyones asked here yet he didnt want to believe me like id lie
Sounds like https://github.com/dotnet/runtime/issues/83568
The second comments gives more info why Terminal behaves this way
GitHub
System.Console.Clear() sometimes did not clear the console buffer. ...
Description When running a console application that calls Console.Clear() from a command prompt on Windows Terminal, the console buffer may not be completely cleared. This is different behavior tha...
Thank you boss <3, it looks like there is no solution though which is strange
ah okay i think i might understand now what could be a workaround, i was testing some things out and its like it says its cos the scroll, anything above that is what retains
so you either set the consolewindow or display a set amount, then have something like next and before for example