Workaround a Windows 10 1803 bug
I create a secondary buffer to assist with wrap detection. On Win10 1803 writing to this buffer outputs to the active buffer. Disable virtual terminal processing to prevent it.
This commit is contained in:
parent
e8ce3dffd3
commit
abb0450de4
10
ANSI.c
10
ANSI.c
@ -197,7 +197,7 @@
|
||||
v1.83, 16 February, 2018:
|
||||
create the flush thread on first use.
|
||||
|
||||
v1.84-wip, 17 February, 26 April to 9 May, 2018:
|
||||
v1.84-wip, 17 February, 26 April to 10 May, 2018:
|
||||
close the flush handles on detach;
|
||||
dynamically load WINMM.DLL;
|
||||
use sprintf/_snprintf/_snwprintf instead of wsprintf, avoiding USER32.DLL;
|
||||
@ -208,7 +208,8 @@
|
||||
remove dependency on the CRT;
|
||||
increase heap to 256KiB to fix logging of really long command lines;
|
||||
default to 7 or -7 if ANSICON_DEF could not be parsed;
|
||||
scrolling will use the default attribute for new lines.
|
||||
scrolling will use the default attribute for new lines;
|
||||
workaround Windows 10 1803 console bug.
|
||||
*/
|
||||
|
||||
#include "ansicon.h"
|
||||
@ -771,6 +772,11 @@ void FlushBuffer( void )
|
||||
SetConsoleMode( hConWrap, (awm) ? ENABLE_WRAP_AT_EOL_OUTPUT : 0 );
|
||||
else if (!awm)
|
||||
SetConsoleMode( hConWrap, ENABLE_PROCESSED_OUTPUT );
|
||||
else if (cache[0].mode & 4) // ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
{
|
||||
// Windows 10 1803 writes to the active buffer if VT is enabled.
|
||||
SetConsoleMode( hConWrap, cache[0].mode & ~4 );
|
||||
}
|
||||
WriteConsole( hConWrap, ChBuffer, nCharInBuffer, &nWritten, NULL );
|
||||
GetConsoleScreenBufferInfo( hConWrap, &wi );
|
||||
if (pState->tb_margins && CUR.Y + wi.CURPOS.Y > TOP + pState->bot_margin)
|
||||
|
@ -94,7 +94,7 @@
|
||||
import the DLL.
|
||||
*/
|
||||
|
||||
#define PDATE L"9 May, 2018"
|
||||
#define PDATE L"10 May, 2018"
|
||||
|
||||
#include "ansicon.h"
|
||||
#include "version.h"
|
||||
|
@ -339,12 +339,13 @@ Version History
|
||||
|
||||
Legend: + added, - bug-fixed, * changed.
|
||||
|
||||
1.84-wip - 9 May, 2018:
|
||||
1.84-wip - 10 May, 2018:
|
||||
- close the flush handles on detach;
|
||||
- WriteFile wasn't properly testing if its handle was for a console;
|
||||
- use remote load on Win8+ if the process has no IAT;
|
||||
- fix logging really long command lines;
|
||||
- default to 7 or -7 if ANSICON_DEF could not be parsed;
|
||||
- workaround for a Windows 10 1803 console bug (doubled CMD prompt);
|
||||
* remove dependency on CRT & USER32, dynamically load WINMM;
|
||||
* exit process if the primary thread is detached (for processes on Win10
|
||||
that return, rather than call ExitProcess);
|
||||
@ -624,5 +625,5 @@ Distribution
|
||||
in LICENSE.txt.
|
||||
|
||||
|
||||
========================
|
||||
Jason Hood, 9 May, 2018.
|
||||
=========================
|
||||
Jason Hood, 10 May, 2018.
|
||||
|
Loading…
x
Reference in New Issue
Block a user