mirror of https://github.com/wolfSSL/wolfssh.git
Merge pull request #715 from JacobBarthelmeh/examples
case of non-console ouptut handlepull/721/head
commit
0f9e87357b
|
@ -406,11 +406,10 @@ static THREAD_RET readPeer(void* in)
|
||||||
if (args->rawMode == 0) {
|
if (args->rawMode == 0) {
|
||||||
DWORD wrd;
|
DWORD wrd;
|
||||||
|
|
||||||
if (GetConsoleMode(stdoutHandle, &wrd) == FALSE) {
|
/* get console mode will fail on handles that are not a console,
|
||||||
err_sys("Unable to get stdout handle");
|
* i.e. if the stdout is being redirected to a file */
|
||||||
}
|
if (GetConsoleMode(stdoutHandle, &wrd) != FALSE) {
|
||||||
|
/* depend on the terminal to process VT characters */
|
||||||
/* depend on the terminal to process VT characters */
|
|
||||||
#ifndef _WIN32_WINNT_WIN10
|
#ifndef _WIN32_WINNT_WIN10
|
||||||
/* support for virtual terminal processing was introduced in windows 10 */
|
/* support for virtual terminal processing was introduced in windows 10 */
|
||||||
#define _WIN32_WINNT_WIN10 0x0A00
|
#define _WIN32_WINNT_WIN10 0x0A00
|
||||||
|
@ -418,8 +417,9 @@ static THREAD_RET readPeer(void* in)
|
||||||
#if defined(WINVER) && (WINVER >= _WIN32_WINNT_WIN10)
|
#if defined(WINVER) && (WINVER >= _WIN32_WINNT_WIN10)
|
||||||
wrd |= (ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
wrd |= (ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
if (SetConsoleMode(stdoutHandle, wrd) == FALSE) {
|
if (SetConsoleMode(stdoutHandle, wrd) == FALSE) {
|
||||||
err_sys("Unable to set console mode");
|
err_sys("Unable to set console mode");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -370,20 +370,20 @@ static THREAD_RET readPeer(void* in)
|
||||||
if (args->rawMode == 0) {
|
if (args->rawMode == 0) {
|
||||||
DWORD wrd;
|
DWORD wrd;
|
||||||
|
|
||||||
if (GetConsoleMode(stdoutHandle, &wrd) == FALSE) {
|
/* get console mode will fail on handles that are not a console,
|
||||||
err_sys("Unable to get stdout handle");
|
* i.e. if the stdout is being redirected to a file */
|
||||||
}
|
if (GetConsoleMode(stdoutHandle, &wrd) != FALSE) {
|
||||||
|
/* depend on the terminal to process VT characters */
|
||||||
/* depend on the terminal to process VT characters */
|
#ifndef _WIN32_WINNT_WIN10
|
||||||
#ifndef _WIN32_WINNT_WIN10
|
/* support for virtual terminal processing was introduced in windows 10 */
|
||||||
/* support for virtual terminal processing was introduced in windows 10 */
|
#define _WIN32_WINNT_WIN10 0x0A00
|
||||||
#define _WIN32_WINNT_WIN10 0x0A00
|
#endif
|
||||||
#endif
|
#if defined(WINVER) && (WINVER >= _WIN32_WINNT_WIN10)
|
||||||
#if defined(WINVER) && (WINVER >= _WIN32_WINNT_WIN10)
|
wrd |= (ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
||||||
wrd |= (ENABLE_VIRTUAL_TERMINAL_PROCESSING | ENABLE_PROCESSED_OUTPUT);
|
#endif
|
||||||
#endif
|
if (SetConsoleMode(stdoutHandle, wrd) == FALSE) {
|
||||||
if (SetConsoleMode(stdoutHandle, wrd) == FALSE) {
|
err_sys("Unable to set console mode");
|
||||||
err_sys("Unable to set console mode");
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue