{"action":"created","issue":{"url":"https://api.github.com/repos/rprichard/winpty/issues/31","labels_url":"https://api.github.com/repos/rprichard/winpty/issues/31/labels{/name}","comments_url":"https://api.github.com/repos/rprichard/winpty/issues/31/comments","events_url":"https://api.github.com/repos/rprichard/winpty/issues/31/events","html_url":"https://github.com/rprichard/winpty/issues/31","id":98953534,"number":31,"title":"winpty-agent.exe hangs on Windows 10 upon terminal resize","user":{"login":"aleherb","id":6852149,"avatar_url":"https://avatars.githubusercontent.com/u/6852149?v=3","gravatar_id":"","url":"https://api.github.com/users/aleherb","html_url":"https://github.com/aleherb","followers_url":"https://api.github.com/users/aleherb/followers","following_url":"https://api.github.com/users/aleherb/following{/other_user}","gists_url":"https://api.github.com/users/aleherb/gists{/gist_id}","starred_url":"https://api.github.com/users/aleherb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleherb/subscriptions","organizations_url":"https://api.github.com/users/aleherb/orgs","repos_url":"https://api.github.com/users/aleherb/repos","events_url":"https://api.github.com/users/aleherb/events{/privacy}","received_events_url":"https://api.github.com/users/aleherb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-08-04T12:12:03Z","updated_at":"2015-08-10T18:05:54Z","closed_at":null,"body":"E.g. within mintty, execute \r\n```\r\nconsole.exe cmd\r\n```\r\nthen resize the terminal window -> winpty-agent.exe hangs in \r\n```\r\n(gdb) bt\r\n#0 0x77c28c3c in ntdll!ZwDeviceIoControlFile () from C:\\Windows\\SYSTEM32\\ntdll.dll\r\n#1 0x76e8c8e9 in KERNELBASE!GetConsoleMode () from C:\\Windows\\SYSTEM32\\KernelBase.dll\r\n#2 0x76e8c7fa in KERNELBASE!GetConsoleMode () from C:\\Windows\\SYSTEM32\\KernelBase.dll\r\n#3 0x76f03230 in SetConsoleScreenBufferSize () from C:\\Windows\\SYSTEM32\\KernelBase.dll\r\n#4 0x0040485c in Win32Console::resizeBuffer(Coord const&) ()\r\n#5 0x00404a97 in Win32Console::reposition(Coord const&, SmallRect const&) ()\r\n#6 0x004033b1 in Agent::resizeWindow(int, int) ()\r\n#7 0x00402dff in Agent::handleSetSizePacket(ReadBuffer&) ()\r\n#8 0x0040295d in Agent::handlePacket(ReadBuffer&) ()\r\n#9 0x004028d1 in Agent::pollControlSocket() ()\r\n#10 0x0040275c in Agent::onPipeIo(NamedPipe*) ()\r\n#11 0x0040154a in EventLoop::run() ()\r\n#12 0x004064e6 in main () \r\n```\r\nWorkaround: Enable legacy console in cmd > Properties.\r\n\r\nThe following patch seems to prevent the hang:\r\n```\r\ndiff --git a/agent/Agent.cc b/agent/Agent.cc\r\nindex 5983ab9..52c5c4b 100644\r\n--- a/agent/Agent.cc\r\n+++ b/agent/Agent.cc\r\n@@ -392,8 +392,8 @@ void Agent::resizeWindow(int cols, int rows)\r\n         markEntireWindowDirty();\r\n     m_dirtyWindowTop = newWindowRect.top();\r\n\r\n-    m_console->reposition(newBufferSize, newWindowRect);\r\n     unfreezeConsole();\r\n+    m_console->reposition(newBufferSize, newWindowRect);\r\n }\r\n\r\n void Agent::scrapeOutput()\r\n```"},"comment":{"url":"https://api.github.com/repos/rprichard/winpty/issues/comments/129551800","html_url":"https://github.com/rprichard/winpty/issues/31#issuecomment-129551800","issue_url":"https://api.github.com/repos/rprichard/winpty/issues/31","id":129551800,"user":{"login":"traff","id":1814841,"avatar_url":"https://avatars.githubusercontent.com/u/1814841?v=3","gravatar_id":"","url":"https://api.github.com/users/traff","html_url":"https://github.com/traff","followers_url":"https://api.github.com/users/traff/followers","following_url":"https://api.github.com/users/traff/following{/other_user}","gists_url":"https://api.github.com/users/traff/gists{/gist_id}","starred_url":"https://api.github.com/users/traff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/traff/subscriptions","organizations_url":"https://api.github.com/users/traff/orgs","repos_url":"https://api.github.com/users/traff/repos","events_url":"https://api.github.com/users/traff/events{/privacy}","received_events_url":"https://api.github.com/users/traff/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T18:05:54Z","updated_at":"2015-08-10T18:05:54Z","body":"Confirm, that fixes the hang on Windows 10."}}