Page 1 of 1
Prevent CMD from flickering
Posted: 06 Apr 2016 07:19
by Hradschek
How do I prevent the console window from flickering? After pressing [ENTER] the last command is repeated. This causes that the window is flickering. Do you guys know how to fix this?
Greetings
Abel Hradschek, Neu Lewin
Re: Prevent CMD from flickering
Posted: 06 Apr 2016 23:34
by ShadowThief
PAUSE by itself doesn't have that behavior, so without seeing your code, I couldn't even begin to guess what's wrong with it.
Re: Prevent CMD from flickering
Posted: 07 Apr 2016 03:18
by Hradschek
Thank you. I'll test it today with PAUSE but i have another idea how to fix it.
Re: Prevent CMD from flickering
Posted: 07 Apr 2016 15:01
by Hradschek
There is nothing wrong with my code, it is because of Windows.
The auto-repeat with pressing ENTER or hold ENTER pressed causes this problem because i have a while loop that runs until the command is repeated 100 times (but only if you press ENTER or hold ENTER after typing a specific command). I know there is a method called 'Double-Buffering'. Are you able to tell me more about this?
Re: Prevent CMD from flickering
Posted: 07 Apr 2016 17:23
by foxidrive
double buffering isn't a batch tool.
Tell us which part of your code makes this happen - make a sample batch file so we can see what you mean, because your descriptions so far don't explain what you are doing in code, or give us any real idea of what is happening.
if you know of some method using double buffering, then show a URL so we can know what you are referring to.
Re: Prevent CMD from flickering
Posted: 08 Apr 2016 02:01
by Hradschek
Someone wrote this code, but it doesnt work in my code.
Code: Select all
@echo off & setlocal EnableDelayedExpansion
rem tuning flickering
rem use fonts 8x8 or Lucida Console 5
mode 120,80
set LF=^
rem above 2 blank lines necessary!
set st0=°±²Û²±°
set st=!st0!g!st0!o!st0!u!st0!z
set st=!st!!st!!st!!st!!st!
set "sp= "
set [=!sp!By Einstein1969!sp!=]!LF!!st!!st!!st!!st!!st!!st!!st!!st!!st!
rem empty env for faster execution
For /f "delims==" %%v in ('set') do if not %%v == [ set %%v=
set/p "AF=Do you want use anti-flicker? [Y/N] "
If /I "!AF!" == "Y" goto :Antiflicker
set AF=
for /L %%N in (1,1,1000000) do (
cls&set
set /a "_=%%N %% 1000"
if !_! equ 0 (
if !`! gtr 60 (
set [=
The flicker is stronger than before.
Re: Prevent CMD from flickering
Posted: 09 Apr 2016 08:21
by foxidrive
See here:
viewtopic.php?f=3&t=6108Send a PM to a mod to reopen your thread, if you decide to provide details.
I asked you quite politely for explanation or sample code, but there ya go.