From 68ad673db4bf971b5c087cef19bb32953fd9db75 Mon Sep 17 00:00:00 2001 From: Manoj Ampalam Date: Fri, 11 Jan 2019 12:19:39 -0800 Subject: [PATCH] Workaround for PTY regressions Changes from #353 enabled closing of previously duplicated Console handles - this is causing TTY rendering issues in ssh.exe. Added a workaround for now to skip closing Console handles. --- contrib/win32/win32compat/termio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/win32/win32compat/termio.c b/contrib/win32/win32compat/termio.c index 925022582aa1..a986b854f074 100644 --- a/contrib/win32/win32compat/termio.c +++ b/contrib/win32/win32compat/termio.c @@ -266,7 +266,9 @@ syncio_close(struct w32_io* pio) WaitForSingleObject(pio->write_overlapped.hEvent, INFINITE); /* drain queued APCs */ SleepEx(0, TRUE); - CloseHandle(WINHANDLE(pio)); + /* TODO - fix this, closing Console handles is interfering with TTY/PTY rendering */ + if (FILETYPE(pio) != FILE_TYPE_CHAR) + CloseHandle(WINHANDLE(pio)); if (pio->read_details.buf) free(pio->read_details.buf); if (pio->write_details.buf)