wtt-connect 0.2.18 → 0.2.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/package.json +2 -5
  2. package/src/adapters/codex.js +144 -2
  3. package/src/runner.js +258 -0
  4. package/src/store.js +6 -0
  5. package/src/terminal-session.js +12 -1
  6. package/node_modules/node-addon-api/LICENSE.md +0 -9
  7. package/node_modules/node-addon-api/README.md +0 -319
  8. package/node_modules/node-addon-api/common.gypi +0 -20
  9. package/node_modules/node-addon-api/except.gypi +0 -25
  10. package/node_modules/node-addon-api/index.js +0 -12
  11. package/node_modules/node-addon-api/napi-inl.deprecated.h +0 -186
  12. package/node_modules/node-addon-api/napi-inl.h +0 -6607
  13. package/node_modules/node-addon-api/napi.h +0 -3201
  14. package/node_modules/node-addon-api/node_addon_api.gyp +0 -32
  15. package/node_modules/node-addon-api/node_api.gyp +0 -9
  16. package/node_modules/node-addon-api/noexcept.gypi +0 -26
  17. package/node_modules/node-addon-api/nothing.c +0 -0
  18. package/node_modules/node-addon-api/package-support.json +0 -21
  19. package/node_modules/node-addon-api/package.json +0 -480
  20. package/node_modules/node-addon-api/tools/README.md +0 -73
  21. package/node_modules/node-addon-api/tools/check-napi.js +0 -99
  22. package/node_modules/node-addon-api/tools/clang-format.js +0 -71
  23. package/node_modules/node-addon-api/tools/conversion.js +0 -301
  24. package/node_modules/node-addon-api/tools/eslint-format.js +0 -79
  25. package/node_modules/node-pty/LICENSE +0 -69
  26. package/node_modules/node-pty/README.md +0 -165
  27. package/node_modules/node-pty/binding.gyp +0 -111
  28. package/node_modules/node-pty/build/Makefile +0 -369
  29. package/node_modules/node-pty/build/Release/pty.node +0 -0
  30. package/node_modules/node-pty/build/binding.Makefile +0 -6
  31. package/node_modules/node-pty/build/config.gypi +0 -503
  32. package/node_modules/node-pty/build/pty.target.mk +0 -168
  33. package/node_modules/node-pty/deps/.editorconfig +0 -2
  34. package/node_modules/node-pty/deps/winpty/.drone.yml +0 -17
  35. package/node_modules/node-pty/deps/winpty/.gitattributes +0 -19
  36. package/node_modules/node-pty/deps/winpty/LICENSE +0 -21
  37. package/node_modules/node-pty/deps/winpty/Makefile +0 -166
  38. package/node_modules/node-pty/deps/winpty/README.md +0 -151
  39. package/node_modules/node-pty/deps/winpty/RELEASES.md +0 -280
  40. package/node_modules/node-pty/deps/winpty/VERSION.txt +0 -1
  41. package/node_modules/node-pty/deps/winpty/configure +0 -167
  42. package/node_modules/node-pty/deps/winpty/misc/BufferResizeTests.cc +0 -90
  43. package/node_modules/node-pty/deps/winpty/misc/ChangeScreenBuffer.cc +0 -53
  44. package/node_modules/node-pty/deps/winpty/misc/ClearConsole.cc +0 -72
  45. package/node_modules/node-pty/deps/winpty/misc/ConinMode.cc +0 -117
  46. package/node_modules/node-pty/deps/winpty/misc/ConinMode.ps1 +0 -116
  47. package/node_modules/node-pty/deps/winpty/misc/ConoutMode.cc +0 -113
  48. package/node_modules/node-pty/deps/winpty/misc/DebugClient.py +0 -42
  49. package/node_modules/node-pty/deps/winpty/misc/DebugServer.py +0 -63
  50. package/node_modules/node-pty/deps/winpty/misc/DumpLines.py +0 -5
  51. package/node_modules/node-pty/deps/winpty/misc/EnableExtendedFlags.txt +0 -46
  52. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +0 -528
  53. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +0 -633
  54. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP932.txt +0 -630
  55. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP936.txt +0 -630
  56. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP949.txt +0 -630
  57. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/CP950.txt +0 -630
  58. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +0 -16
  59. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Results.txt +0 -4
  60. package/node_modules/node-pty/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +0 -144
  61. package/node_modules/node-pty/deps/winpty/misc/FontSurvey.cc +0 -100
  62. package/node_modules/node-pty/deps/winpty/misc/FormatChar.h +0 -21
  63. package/node_modules/node-pty/deps/winpty/misc/FreezePerfTest.cc +0 -62
  64. package/node_modules/node-pty/deps/winpty/misc/GetCh.cc +0 -20
  65. package/node_modules/node-pty/deps/winpty/misc/GetConsolePos.cc +0 -41
  66. package/node_modules/node-pty/deps/winpty/misc/GetFont.cc +0 -261
  67. package/node_modules/node-pty/deps/winpty/misc/IdentifyConsoleWindow.ps1 +0 -51
  68. package/node_modules/node-pty/deps/winpty/misc/IsNewConsole.cc +0 -87
  69. package/node_modules/node-pty/deps/winpty/misc/MouseInputNotes.txt +0 -90
  70. package/node_modules/node-pty/deps/winpty/misc/MoveConsoleWindow.cc +0 -34
  71. package/node_modules/node-pty/deps/winpty/misc/Notes.txt +0 -219
  72. package/node_modules/node-pty/deps/winpty/misc/OSVersion.cc +0 -27
  73. package/node_modules/node-pty/deps/winpty/misc/ScreenBufferFreezeInactive.cc +0 -101
  74. package/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest.cc +0 -671
  75. package/node_modules/node-pty/deps/winpty/misc/ScreenBufferTest2.cc +0 -151
  76. package/node_modules/node-pty/deps/winpty/misc/SelectAllTest.cc +0 -45
  77. package/node_modules/node-pty/deps/winpty/misc/SetBufferSize.cc +0 -32
  78. package/node_modules/node-pty/deps/winpty/misc/SetCursorPos.cc +0 -10
  79. package/node_modules/node-pty/deps/winpty/misc/SetFont.cc +0 -145
  80. package/node_modules/node-pty/deps/winpty/misc/SetWindowRect.cc +0 -36
  81. package/node_modules/node-pty/deps/winpty/misc/ShowArgv.cc +0 -12
  82. package/node_modules/node-pty/deps/winpty/misc/ShowConsoleInput.cc +0 -40
  83. package/node_modules/node-pty/deps/winpty/misc/Spew.py +0 -5
  84. package/node_modules/node-pty/deps/winpty/misc/TestUtil.cc +0 -172
  85. package/node_modules/node-pty/deps/winpty/misc/UnicodeDoubleWidthTest.cc +0 -102
  86. package/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest1.cc +0 -246
  87. package/node_modules/node-pty/deps/winpty/misc/UnicodeWideTest2.cc +0 -130
  88. package/node_modules/node-pty/deps/winpty/misc/UnixEcho.cc +0 -89
  89. package/node_modules/node-pty/deps/winpty/misc/Utf16Echo.cc +0 -46
  90. package/node_modules/node-pty/deps/winpty/misc/VeryLargeRead.cc +0 -122
  91. package/node_modules/node-pty/deps/winpty/misc/VkEscapeTest.cc +0 -56
  92. package/node_modules/node-pty/deps/winpty/misc/Win10ResizeWhileFrozen.cc +0 -52
  93. package/node_modules/node-pty/deps/winpty/misc/Win10WrapTest1.cc +0 -57
  94. package/node_modules/node-pty/deps/winpty/misc/Win10WrapTest2.cc +0 -30
  95. package/node_modules/node-pty/deps/winpty/misc/Win32Echo1.cc +0 -26
  96. package/node_modules/node-pty/deps/winpty/misc/Win32Echo2.cc +0 -19
  97. package/node_modules/node-pty/deps/winpty/misc/Win32Test1.cc +0 -46
  98. package/node_modules/node-pty/deps/winpty/misc/Win32Test2.cc +0 -70
  99. package/node_modules/node-pty/deps/winpty/misc/Win32Test3.cc +0 -78
  100. package/node_modules/node-pty/deps/winpty/misc/Win32Write1.cc +0 -44
  101. package/node_modules/node-pty/deps/winpty/misc/WindowsBugCrashReader.cc +0 -27
  102. package/node_modules/node-pty/deps/winpty/misc/WriteConsole.cc +0 -106
  103. package/node_modules/node-pty/deps/winpty/misc/build32.sh +0 -9
  104. package/node_modules/node-pty/deps/winpty/misc/build64.sh +0 -9
  105. package/node_modules/node-pty/deps/winpty/misc/color-test.sh +0 -212
  106. package/node_modules/node-pty/deps/winpty/misc/font-notes.txt +0 -300
  107. package/node_modules/node-pty/deps/winpty/misc/winbug-15048.cc +0 -201
  108. package/node_modules/node-pty/deps/winpty/ship/build-pty4j-libpty.bat +0 -36
  109. package/node_modules/node-pty/deps/winpty/ship/common_ship.py +0 -53
  110. package/node_modules/node-pty/deps/winpty/ship/make_msvc_package.py +0 -165
  111. package/node_modules/node-pty/deps/winpty/ship/ship.py +0 -108
  112. package/node_modules/node-pty/deps/winpty/src/agent/Agent.cc +0 -613
  113. package/node_modules/node-pty/deps/winpty/src/agent/Agent.h +0 -103
  114. package/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.cc +0 -84
  115. package/node_modules/node-pty/deps/winpty/src/agent/AgentCreateDesktop.h +0 -28
  116. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.cc +0 -632
  117. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleFont.h +0 -28
  118. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.cc +0 -852
  119. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInput.h +0 -109
  120. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.cc +0 -121
  121. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleInputReencoding.h +0 -36
  122. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.cc +0 -152
  123. package/node_modules/node-pty/deps/winpty/src/agent/ConsoleLine.h +0 -41
  124. package/node_modules/node-pty/deps/winpty/src/agent/Coord.h +0 -87
  125. package/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.cc +0 -239
  126. package/node_modules/node-pty/deps/winpty/src/agent/DebugShowInput.h +0 -32
  127. package/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.cc +0 -422
  128. package/node_modules/node-pty/deps/winpty/src/agent/DefaultInputMap.h +0 -28
  129. package/node_modules/node-pty/deps/winpty/src/agent/DsrSender.h +0 -30
  130. package/node_modules/node-pty/deps/winpty/src/agent/EventLoop.cc +0 -99
  131. package/node_modules/node-pty/deps/winpty/src/agent/EventLoop.h +0 -47
  132. package/node_modules/node-pty/deps/winpty/src/agent/InputMap.cc +0 -246
  133. package/node_modules/node-pty/deps/winpty/src/agent/InputMap.h +0 -114
  134. package/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.cc +0 -71
  135. package/node_modules/node-pty/deps/winpty/src/agent/LargeConsoleRead.h +0 -68
  136. package/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.cc +0 -378
  137. package/node_modules/node-pty/deps/winpty/src/agent/NamedPipe.h +0 -125
  138. package/node_modules/node-pty/deps/winpty/src/agent/Scraper.cc +0 -699
  139. package/node_modules/node-pty/deps/winpty/src/agent/Scraper.h +0 -103
  140. package/node_modules/node-pty/deps/winpty/src/agent/SimplePool.h +0 -75
  141. package/node_modules/node-pty/deps/winpty/src/agent/SmallRect.h +0 -143
  142. package/node_modules/node-pty/deps/winpty/src/agent/Terminal.cc +0 -535
  143. package/node_modules/node-pty/deps/winpty/src/agent/Terminal.h +0 -69
  144. package/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncoding.h +0 -157
  145. package/node_modules/node-pty/deps/winpty/src/agent/UnicodeEncodingTest.cc +0 -189
  146. package/node_modules/node-pty/deps/winpty/src/agent/Win32Console.cc +0 -107
  147. package/node_modules/node-pty/deps/winpty/src/agent/Win32Console.h +0 -67
  148. package/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.cc +0 -193
  149. package/node_modules/node-pty/deps/winpty/src/agent/Win32ConsoleBuffer.h +0 -99
  150. package/node_modules/node-pty/deps/winpty/src/agent/main.cc +0 -114
  151. package/node_modules/node-pty/deps/winpty/src/agent/subdir.mk +0 -61
  152. package/node_modules/node-pty/deps/winpty/src/configurations.gypi +0 -60
  153. package/node_modules/node-pty/deps/winpty/src/debugserver/DebugServer.cc +0 -117
  154. package/node_modules/node-pty/deps/winpty/src/debugserver/subdir.mk +0 -41
  155. package/node_modules/node-pty/deps/winpty/src/include/winpty.h +0 -242
  156. package/node_modules/node-pty/deps/winpty/src/include/winpty_constants.h +0 -131
  157. package/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.cc +0 -75
  158. package/node_modules/node-pty/deps/winpty/src/libwinpty/AgentLocation.h +0 -28
  159. package/node_modules/node-pty/deps/winpty/src/libwinpty/LibWinptyException.h +0 -54
  160. package/node_modules/node-pty/deps/winpty/src/libwinpty/WinptyInternal.h +0 -72
  161. package/node_modules/node-pty/deps/winpty/src/libwinpty/subdir.mk +0 -46
  162. package/node_modules/node-pty/deps/winpty/src/libwinpty/winpty.cc +0 -970
  163. package/node_modules/node-pty/deps/winpty/src/shared/AgentMsg.h +0 -38
  164. package/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.cc +0 -122
  165. package/node_modules/node-pty/deps/winpty/src/shared/BackgroundDesktop.h +0 -73
  166. package/node_modules/node-pty/deps/winpty/src/shared/Buffer.cc +0 -103
  167. package/node_modules/node-pty/deps/winpty/src/shared/Buffer.h +0 -102
  168. package/node_modules/node-pty/deps/winpty/src/shared/DebugClient.cc +0 -187
  169. package/node_modules/node-pty/deps/winpty/src/shared/DebugClient.h +0 -38
  170. package/node_modules/node-pty/deps/winpty/src/shared/GenRandom.cc +0 -138
  171. package/node_modules/node-pty/deps/winpty/src/shared/GenRandom.h +0 -55
  172. package/node_modules/node-pty/deps/winpty/src/shared/GetCommitHash.bat +0 -13
  173. package/node_modules/node-pty/deps/winpty/src/shared/Mutex.h +0 -54
  174. package/node_modules/node-pty/deps/winpty/src/shared/OsModule.h +0 -63
  175. package/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.cc +0 -36
  176. package/node_modules/node-pty/deps/winpty/src/shared/OwnedHandle.h +0 -45
  177. package/node_modules/node-pty/deps/winpty/src/shared/PrecompiledHeader.h +0 -43
  178. package/node_modules/node-pty/deps/winpty/src/shared/StringBuilder.h +0 -227
  179. package/node_modules/node-pty/deps/winpty/src/shared/StringBuilderTest.cc +0 -114
  180. package/node_modules/node-pty/deps/winpty/src/shared/StringUtil.cc +0 -55
  181. package/node_modules/node-pty/deps/winpty/src/shared/StringUtil.h +0 -80
  182. package/node_modules/node-pty/deps/winpty/src/shared/TimeMeasurement.h +0 -63
  183. package/node_modules/node-pty/deps/winpty/src/shared/UnixCtrlChars.h +0 -45
  184. package/node_modules/node-pty/deps/winpty/src/shared/UpdateGenVersion.bat +0 -20
  185. package/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.cc +0 -460
  186. package/node_modules/node-pty/deps/winpty/src/shared/WindowsSecurity.h +0 -104
  187. package/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.cc +0 -252
  188. package/node_modules/node-pty/deps/winpty/src/shared/WindowsVersion.h +0 -29
  189. package/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.cc +0 -55
  190. package/node_modules/node-pty/deps/winpty/src/shared/WinptyAssert.h +0 -64
  191. package/node_modules/node-pty/deps/winpty/src/shared/WinptyException.cc +0 -57
  192. package/node_modules/node-pty/deps/winpty/src/shared/WinptyException.h +0 -43
  193. package/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.cc +0 -42
  194. package/node_modules/node-pty/deps/winpty/src/shared/WinptyVersion.h +0 -27
  195. package/node_modules/node-pty/deps/winpty/src/shared/winpty_snprintf.h +0 -99
  196. package/node_modules/node-pty/deps/winpty/src/subdir.mk +0 -5
  197. package/node_modules/node-pty/deps/winpty/src/tests/subdir.mk +0 -28
  198. package/node_modules/node-pty/deps/winpty/src/tests/trivial_test.cc +0 -158
  199. package/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.cc +0 -114
  200. package/node_modules/node-pty/deps/winpty/src/unix-adapter/InputHandler.h +0 -56
  201. package/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.cc +0 -80
  202. package/node_modules/node-pty/deps/winpty/src/unix-adapter/OutputHandler.h +0 -53
  203. package/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.cc +0 -86
  204. package/node_modules/node-pty/deps/winpty/src/unix-adapter/Util.h +0 -31
  205. package/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.cc +0 -70
  206. package/node_modules/node-pty/deps/winpty/src/unix-adapter/WakeupFd.h +0 -42
  207. package/node_modules/node-pty/deps/winpty/src/unix-adapter/main.cc +0 -729
  208. package/node_modules/node-pty/deps/winpty/src/unix-adapter/subdir.mk +0 -41
  209. package/node_modules/node-pty/deps/winpty/src/winpty.gyp +0 -234
  210. package/node_modules/node-pty/deps/winpty/vcbuild.bat +0 -83
  211. package/node_modules/node-pty/lib/conpty_console_list_agent.js +0 -16
  212. package/node_modules/node-pty/lib/conpty_console_list_agent.js.map +0 -1
  213. package/node_modules/node-pty/lib/eventEmitter2.js +0 -47
  214. package/node_modules/node-pty/lib/eventEmitter2.js.map +0 -1
  215. package/node_modules/node-pty/lib/eventEmitter2.test.js +0 -30
  216. package/node_modules/node-pty/lib/eventEmitter2.test.js.map +0 -1
  217. package/node_modules/node-pty/lib/index.js +0 -52
  218. package/node_modules/node-pty/lib/index.js.map +0 -1
  219. package/node_modules/node-pty/lib/interfaces.js +0 -7
  220. package/node_modules/node-pty/lib/interfaces.js.map +0 -1
  221. package/node_modules/node-pty/lib/shared/conout.js +0 -11
  222. package/node_modules/node-pty/lib/shared/conout.js.map +0 -1
  223. package/node_modules/node-pty/lib/terminal.js +0 -190
  224. package/node_modules/node-pty/lib/terminal.js.map +0 -1
  225. package/node_modules/node-pty/lib/terminal.test.js +0 -139
  226. package/node_modules/node-pty/lib/terminal.test.js.map +0 -1
  227. package/node_modules/node-pty/lib/testUtils.test.js +0 -28
  228. package/node_modules/node-pty/lib/testUtils.test.js.map +0 -1
  229. package/node_modules/node-pty/lib/types.js +0 -7
  230. package/node_modules/node-pty/lib/types.js.map +0 -1
  231. package/node_modules/node-pty/lib/unixTerminal.js +0 -346
  232. package/node_modules/node-pty/lib/unixTerminal.js.map +0 -1
  233. package/node_modules/node-pty/lib/unixTerminal.test.js +0 -351
  234. package/node_modules/node-pty/lib/unixTerminal.test.js.map +0 -1
  235. package/node_modules/node-pty/lib/utils.js +0 -39
  236. package/node_modules/node-pty/lib/utils.js.map +0 -1
  237. package/node_modules/node-pty/lib/windowsConoutConnection.js +0 -125
  238. package/node_modules/node-pty/lib/windowsConoutConnection.js.map +0 -1
  239. package/node_modules/node-pty/lib/windowsPtyAgent.js +0 -320
  240. package/node_modules/node-pty/lib/windowsPtyAgent.js.map +0 -1
  241. package/node_modules/node-pty/lib/windowsPtyAgent.test.js +0 -90
  242. package/node_modules/node-pty/lib/windowsPtyAgent.test.js.map +0 -1
  243. package/node_modules/node-pty/lib/windowsTerminal.js +0 -199
  244. package/node_modules/node-pty/lib/windowsTerminal.js.map +0 -1
  245. package/node_modules/node-pty/lib/windowsTerminal.test.js +0 -219
  246. package/node_modules/node-pty/lib/windowsTerminal.test.js.map +0 -1
  247. package/node_modules/node-pty/lib/worker/conoutSocketWorker.js +0 -22
  248. package/node_modules/node-pty/lib/worker/conoutSocketWorker.js.map +0 -1
  249. package/node_modules/node-pty/node-addon-api/node_addon_api.Makefile +0 -6
  250. package/node_modules/node-pty/node-addon-api/node_addon_api.target.mk +0 -106
  251. package/node_modules/node-pty/node-addon-api/node_addon_api_except.target.mk +0 -110
  252. package/node_modules/node-pty/node-addon-api/node_addon_api_maybe.target.mk +0 -106
  253. package/node_modules/node-pty/package.json +0 -64
  254. package/node_modules/node-pty/prebuilds/darwin-arm64/pty.node +0 -0
  255. package/node_modules/node-pty/prebuilds/darwin-arm64/spawn-helper +0 -0
  256. package/node_modules/node-pty/prebuilds/darwin-x64/pty.node +0 -0
  257. package/node_modules/node-pty/prebuilds/darwin-x64/spawn-helper +0 -0
  258. package/node_modules/node-pty/prebuilds/win32-arm64/conpty/OpenConsole.exe +0 -0
  259. package/node_modules/node-pty/prebuilds/win32-arm64/conpty/conpty.dll +0 -0
  260. package/node_modules/node-pty/prebuilds/win32-arm64/conpty.node +0 -0
  261. package/node_modules/node-pty/prebuilds/win32-arm64/conpty.pdb +0 -0
  262. package/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.node +0 -0
  263. package/node_modules/node-pty/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
  264. package/node_modules/node-pty/prebuilds/win32-arm64/pty.node +0 -0
  265. package/node_modules/node-pty/prebuilds/win32-arm64/pty.pdb +0 -0
  266. package/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.exe +0 -0
  267. package/node_modules/node-pty/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
  268. package/node_modules/node-pty/prebuilds/win32-arm64/winpty.dll +0 -0
  269. package/node_modules/node-pty/prebuilds/win32-arm64/winpty.pdb +0 -0
  270. package/node_modules/node-pty/prebuilds/win32-x64/conpty/OpenConsole.exe +0 -0
  271. package/node_modules/node-pty/prebuilds/win32-x64/conpty/conpty.dll +0 -0
  272. package/node_modules/node-pty/prebuilds/win32-x64/conpty.node +0 -0
  273. package/node_modules/node-pty/prebuilds/win32-x64/conpty.pdb +0 -0
  274. package/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.node +0 -0
  275. package/node_modules/node-pty/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
  276. package/node_modules/node-pty/prebuilds/win32-x64/pty.node +0 -0
  277. package/node_modules/node-pty/prebuilds/win32-x64/pty.pdb +0 -0
  278. package/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.exe +0 -0
  279. package/node_modules/node-pty/prebuilds/win32-x64/winpty-agent.pdb +0 -0
  280. package/node_modules/node-pty/prebuilds/win32-x64/winpty.dll +0 -0
  281. package/node_modules/node-pty/prebuilds/win32-x64/winpty.pdb +0 -0
  282. package/node_modules/node-pty/scripts/gen-compile-commands.js +0 -8
  283. package/node_modules/node-pty/scripts/increment-version.js +0 -54
  284. package/node_modules/node-pty/scripts/post-install.js +0 -80
  285. package/node_modules/node-pty/scripts/prebuild.js +0 -34
  286. package/node_modules/node-pty/src/conpty_console_list_agent.ts +0 -15
  287. package/node_modules/node-pty/src/eventEmitter2.test.ts +0 -30
  288. package/node_modules/node-pty/src/eventEmitter2.ts +0 -48
  289. package/node_modules/node-pty/src/index.ts +0 -52
  290. package/node_modules/node-pty/src/interfaces.ts +0 -130
  291. package/node_modules/node-pty/src/native.d.ts +0 -54
  292. package/node_modules/node-pty/src/shared/conout.ts +0 -15
  293. package/node_modules/node-pty/src/terminal.test.ts +0 -119
  294. package/node_modules/node-pty/src/terminal.ts +0 -211
  295. package/node_modules/node-pty/src/testUtils.test.ts +0 -23
  296. package/node_modules/node-pty/src/tsconfig.json +0 -22
  297. package/node_modules/node-pty/src/types.ts +0 -15
  298. package/node_modules/node-pty/src/unix/pty.cc +0 -799
  299. package/node_modules/node-pty/src/unix/spawn-helper.cc +0 -23
  300. package/node_modules/node-pty/src/unixTerminal.test.ts +0 -367
  301. package/node_modules/node-pty/src/unixTerminal.ts +0 -388
  302. package/node_modules/node-pty/src/utils.ts +0 -29
  303. package/node_modules/node-pty/src/win/conpty.cc +0 -583
  304. package/node_modules/node-pty/src/win/conpty.h +0 -41
  305. package/node_modules/node-pty/src/win/conpty_console_list.cc +0 -44
  306. package/node_modules/node-pty/src/win/path_util.cc +0 -95
  307. package/node_modules/node-pty/src/win/path_util.h +0 -26
  308. package/node_modules/node-pty/src/win/winpty.cc +0 -333
  309. package/node_modules/node-pty/src/windowsConoutConnection.ts +0 -82
  310. package/node_modules/node-pty/src/windowsPtyAgent.test.ts +0 -94
  311. package/node_modules/node-pty/src/windowsPtyAgent.ts +0 -321
  312. package/node_modules/node-pty/src/windowsTerminal.test.ts +0 -229
  313. package/node_modules/node-pty/src/windowsTerminal.ts +0 -203
  314. package/node_modules/node-pty/src/worker/conoutSocketWorker.ts +0 -22
  315. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/OpenConsole.exe +0 -0
  316. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-arm64/conpty.dll +0 -0
  317. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/OpenConsole.exe +0 -0
  318. package/node_modules/node-pty/third_party/conpty/1.23.251008001/win10-x64/conpty.dll +0 -0
  319. package/node_modules/node-pty/typings/node-pty.d.ts +0 -211
@@ -1,102 +0,0 @@
1
- // Demonstrates how U+30FC is sometimes handled as a single-width character
2
- // when it should be handled as a double-width character.
3
- //
4
- // It only runs on computers where 932 is a valid code page. Set the system
5
- // local to "Japanese (Japan)" to ensure this.
6
- //
7
- // The problem seems to happen when U+30FC is printed in a console using the
8
- // Lucida Console font, and only when that font is at certain sizes.
9
- //
10
-
11
- #include <windows.h>
12
- #include <assert.h>
13
- #include <locale.h>
14
- #include <stdio.h>
15
- #include <stdlib.h>
16
- #include <string.h>
17
-
18
- #include "TestUtil.cc"
19
-
20
- #define COUNT_OF(x) (sizeof(x) / sizeof((x)[0]))
21
-
22
- static void setFont(const wchar_t *faceName, int pxSize) {
23
- CONSOLE_FONT_INFOEX infoex = {0};
24
- infoex.cbSize = sizeof(infoex);
25
- infoex.dwFontSize.Y = pxSize;
26
- wcsncpy(infoex.FaceName, faceName, COUNT_OF(infoex.FaceName));
27
- BOOL ret = SetCurrentConsoleFontEx(
28
- GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &infoex);
29
- assert(ret);
30
- }
31
-
32
- static bool performTest(const wchar_t testChar) {
33
- const HANDLE conout = GetStdHandle(STD_OUTPUT_HANDLE);
34
-
35
- SetConsoleTextAttribute(conout, 7);
36
-
37
- system("cls");
38
- DWORD actual = 0;
39
- BOOL ret = WriteConsoleW(conout, &testChar, 1, &actual, NULL);
40
- assert(ret && actual == 1);
41
-
42
- CHAR_INFO verify[2];
43
- COORD bufSize = {2, 1};
44
- COORD bufCoord = {0, 0};
45
- const SMALL_RECT readRegion = {0, 0, 1, 0};
46
- SMALL_RECT actualRegion = readRegion;
47
- ret = ReadConsoleOutputW(conout, verify, bufSize, bufCoord, &actualRegion);
48
- assert(ret && !memcmp(&readRegion, &actualRegion, sizeof(readRegion)));
49
- assert(verify[0].Char.UnicodeChar == testChar);
50
-
51
- if (verify[1].Char.UnicodeChar == testChar) {
52
- // Typical double-width behavior with a TrueType font. Pass.
53
- assert(verify[0].Attributes == 0x107);
54
- assert(verify[1].Attributes == 0x207);
55
- return true;
56
- } else if (verify[1].Char.UnicodeChar == 0) {
57
- // Typical double-width behavior with a Raster Font. Pass.
58
- assert(verify[0].Attributes == 7);
59
- assert(verify[1].Attributes == 0);
60
- return true;
61
- } else if (verify[1].Char.UnicodeChar == L' ') {
62
- // Single-width behavior. Fail.
63
- assert(verify[0].Attributes == 7);
64
- assert(verify[1].Attributes == 7);
65
- return false;
66
- } else {
67
- // Unexpected output.
68
- assert(false);
69
- }
70
- }
71
-
72
- int main(int argc, char *argv[]) {
73
- setlocale(LC_ALL, "");
74
- if (argc == 1) {
75
- startChildProcess(L"CHILD");
76
- return 0;
77
- }
78
-
79
- assert(SetConsoleCP(932));
80
- assert(SetConsoleOutputCP(932));
81
-
82
- const wchar_t testChar = 0x30FC;
83
- const wchar_t *const faceNames[] = {
84
- L"Lucida Console",
85
- L"Consolas",
86
- L"MS ゴシック",
87
- };
88
-
89
- trace("Test started");
90
-
91
- for (auto faceName : faceNames) {
92
- for (int px = 1; px <= 50; ++px) {
93
- setFont(faceName, px);
94
- if (!performTest(testChar)) {
95
- trace("FAILURE: %s %dpx", narrowString(faceName).c_str(), px);
96
- }
97
- }
98
- }
99
-
100
- trace("Test complete");
101
- return 0;
102
- }
@@ -1,246 +0,0 @@
1
- #include <windows.h>
2
-
3
- #include <assert.h>
4
- #include <vector>
5
-
6
- #include "TestUtil.cc"
7
-
8
- #define COUNT_OF(x) (sizeof(x) / sizeof((x)[0]))
9
-
10
-
11
- CHAR_INFO ci(wchar_t ch, WORD attributes) {
12
- CHAR_INFO ret;
13
- ret.Char.UnicodeChar = ch;
14
- ret.Attributes = attributes;
15
- return ret;
16
- }
17
-
18
- CHAR_INFO ci(wchar_t ch) {
19
- return ci(ch, 7);
20
- }
21
-
22
- CHAR_INFO ci() {
23
- return ci(L' ');
24
- }
25
-
26
- bool operator==(SMALL_RECT x, SMALL_RECT y) {
27
- return !memcmp(&x, &y, sizeof(x));
28
- }
29
-
30
- SMALL_RECT sr(COORD pt, COORD size) {
31
- return {
32
- pt.X, pt.Y,
33
- static_cast<SHORT>(pt.X + size.X - 1),
34
- static_cast<SHORT>(pt.Y + size.Y - 1)
35
- };
36
- }
37
-
38
- static void set(
39
- const COORD pt,
40
- const COORD size,
41
- const std::vector<CHAR_INFO> &data) {
42
- assert(data.size() == size.X * size.Y);
43
- SMALL_RECT writeRegion = sr(pt, size);
44
- BOOL ret = WriteConsoleOutputW(
45
- GetStdHandle(STD_OUTPUT_HANDLE),
46
- data.data(), size, {0, 0}, &writeRegion);
47
- assert(ret && writeRegion == sr(pt, size));
48
- }
49
-
50
- static void set(
51
- const COORD pt,
52
- const std::vector<CHAR_INFO> &data) {
53
- set(pt, {static_cast<SHORT>(data.size()), 1}, data);
54
- }
55
-
56
- static void writeAttrsAt(
57
- const COORD pt,
58
- const std::vector<WORD> &data) {
59
- DWORD actual = 0;
60
- BOOL ret = WriteConsoleOutputAttribute(
61
- GetStdHandle(STD_OUTPUT_HANDLE),
62
- data.data(), data.size(), pt, &actual);
63
- assert(ret && actual == data.size());
64
- }
65
-
66
- static void writeCharsAt(
67
- const COORD pt,
68
- const std::vector<wchar_t> &data) {
69
- DWORD actual = 0;
70
- BOOL ret = WriteConsoleOutputCharacterW(
71
- GetStdHandle(STD_OUTPUT_HANDLE),
72
- data.data(), data.size(), pt, &actual);
73
- assert(ret && actual == data.size());
74
- }
75
-
76
- static void writeChars(
77
- const std::vector<wchar_t> &data) {
78
- DWORD actual = 0;
79
- BOOL ret = WriteConsoleW(
80
- GetStdHandle(STD_OUTPUT_HANDLE),
81
- data.data(), data.size(), &actual, NULL);
82
- assert(ret && actual == data.size());
83
- }
84
-
85
- std::vector<CHAR_INFO> get(
86
- const COORD pt,
87
- const COORD size) {
88
- std::vector<CHAR_INFO> data(size.X * size.Y);
89
- SMALL_RECT readRegion = sr(pt, size);
90
- BOOL ret = ReadConsoleOutputW(
91
- GetStdHandle(STD_OUTPUT_HANDLE),
92
- data.data(), size, {0, 0}, &readRegion);
93
- assert(ret && readRegion == sr(pt, size));
94
- return data;
95
- }
96
-
97
- std::vector<wchar_t> readCharsAt(
98
- const COORD pt,
99
- int size) {
100
- std::vector<wchar_t> data(size);
101
- DWORD actual = 0;
102
- BOOL ret = ReadConsoleOutputCharacterW(
103
- GetStdHandle(STD_OUTPUT_HANDLE),
104
- data.data(), data.size(), pt, &actual);
105
- assert(ret);
106
- data.resize(actual); // With double-width chars, we can read fewer than `size`.
107
- return data;
108
- }
109
-
110
- static void dump(const COORD pt, const COORD size) {
111
- for (CHAR_INFO ci : get(pt, size)) {
112
- printf("%04X %04X\n", ci.Char.UnicodeChar, ci.Attributes);
113
- }
114
- }
115
-
116
- static void dumpCharsAt(const COORD pt, int size) {
117
- for (wchar_t ch : readCharsAt(pt, size)) {
118
- printf("%04X\n", ch);
119
- }
120
- }
121
-
122
- static COORD getCursorPos() {
123
- CONSOLE_SCREEN_BUFFER_INFO info = { sizeof(info) };
124
- assert(GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info));
125
- return info.dwCursorPosition;
126
- }
127
-
128
- static void test1() {
129
- // We write "䀀䀀", then write "䀁" in the middle of the two. The second
130
- // write turns the first and last cells into spaces. The LEADING/TRAILING
131
- // flags retain consistency.
132
- printf("test1 - overlap full-width char with full-width char\n");
133
- writeCharsAt({1,0}, {0x4000, 0x4000});
134
- dump({0,0}, {6,1});
135
- printf("\n");
136
- writeCharsAt({2,0}, {0x4001});
137
- dump({0,0}, {6,1});
138
- printf("\n");
139
- }
140
-
141
- static void test2() {
142
- // Like `test1`, but use a lower-level API to do the write. Consistency is
143
- // preserved here too -- the first and last cells are replaced with spaces.
144
- printf("test2 - overlap full-width char with full-width char (lowlevel)\n");
145
- writeCharsAt({1,0}, {0x4000, 0x4000});
146
- dump({0,0}, {6,1});
147
- printf("\n");
148
- set({2,0}, {ci(0x4001,0x107), ci(0x4001,0x207)});
149
- dump({0,0}, {6,1});
150
- printf("\n");
151
- }
152
-
153
- static void test3() {
154
- // However, the lower-level API can break the LEADING/TRAILING invariant
155
- // explicitly:
156
- printf("test3 - explicitly violate LEADING/TRAILING using lowlevel API\n");
157
- set({1,0}, {
158
- ci(0x4000, 0x207),
159
- ci(0x4001, 0x107),
160
- ci(0x3044, 7),
161
- ci(L'X', 0x107),
162
- ci(L'X', 0x207),
163
- });
164
- dump({0,0}, {7,1});
165
- }
166
-
167
- static void test4() {
168
- // It is possible for the two cells of a double-width character to have two
169
- // colors.
170
- printf("test4 - use lowlevel to assign two colors to one full-width char\n");
171
- set({0,0}, {
172
- ci(0x4000, 0x142),
173
- ci(0x4000, 0x224),
174
- });
175
- dump({0,0}, {2,1});
176
- }
177
-
178
- static void test5() {
179
- // WriteConsoleOutputAttribute doesn't seem to affect the LEADING/TRAILING
180
- // flags.
181
- printf("test5 - WriteConsoleOutputAttribute cannot affect LEADING/TRAILING\n");
182
-
183
- // Trying to clear the flags doesn't work...
184
- writeCharsAt({0,0}, {0x4000});
185
- dump({0,0}, {2,1});
186
- writeAttrsAt({0,0}, {0x42, 0x24});
187
- printf("\n");
188
- dump({0,0}, {2,1});
189
-
190
- // ... and trying to add them also doesn't work.
191
- writeCharsAt({0,1}, {'A', ' '});
192
- writeAttrsAt({0,1}, {0x107, 0x207});
193
- printf("\n");
194
- dump({0,1}, {2,1});
195
- }
196
-
197
- static void test6() {
198
- // The cursor position may be on either cell of a double-width character.
199
- // Visually, the cursor appears under both cells, regardless of which
200
- // specific one has the cursor.
201
- printf("test6 - cursor can be either left or right cell of full-width char\n");
202
-
203
- writeCharsAt({2,1}, {0x4000});
204
-
205
- setCursorPos(2, 1);
206
- auto pos1 = getCursorPos();
207
- Sleep(1000);
208
-
209
- setCursorPos(3, 1);
210
- auto pos2 = getCursorPos();
211
- Sleep(1000);
212
-
213
- setCursorPos(0, 15);
214
- printf("%d,%d\n", pos1.X, pos1.Y);
215
- printf("%d,%d\n", pos2.X, pos2.Y);
216
- }
217
-
218
- static void runTest(void (&test)()) {
219
- system("cls");
220
- setCursorPos(0, 14);
221
- test();
222
- system("pause");
223
- }
224
-
225
- int main(int argc, char *argv[]) {
226
- if (argc == 1) {
227
- startChildProcess(L"CHILD");
228
- return 0;
229
- }
230
-
231
- setWindowPos(0, 0, 1, 1);
232
- setBufferSize(80, 40);
233
- setWindowPos(0, 0, 80, 40);
234
-
235
- auto cp = GetConsoleOutputCP();
236
- assert(cp == 932 || cp == 936 || cp == 949 || cp == 950);
237
-
238
- runTest(test1);
239
- runTest(test2);
240
- runTest(test3);
241
- runTest(test4);
242
- runTest(test5);
243
- runTest(test6);
244
-
245
- return 0;
246
- }
@@ -1,130 +0,0 @@
1
- //
2
- // Test half-width vs full-width characters.
3
- //
4
-
5
- #include <windows.h>
6
- #include <assert.h>
7
- #include <stdlib.h>
8
- #include <stdio.h>
9
-
10
- #include "TestUtil.cc"
11
-
12
- static void writeChars(const wchar_t *text) {
13
- wcslen(text);
14
- const int len = wcslen(text);
15
- DWORD actual = 0;
16
- BOOL ret = WriteConsoleW(
17
- GetStdHandle(STD_OUTPUT_HANDLE),
18
- text, len, &actual, NULL);
19
- trace("writeChars: ret=%d, actual=%lld", ret, (long long)actual);
20
- }
21
-
22
- static void dumpChars(int x, int y, int w, int h) {
23
- BOOL ret;
24
- const COORD bufSize = {w, h};
25
- const COORD bufCoord = {0, 0};
26
- const SMALL_RECT topLeft = {x, y, x + w - 1, y + h - 1};
27
- CHAR_INFO mbcsData[w * h];
28
- CHAR_INFO unicodeData[w * h];
29
- SMALL_RECT readRegion;
30
- readRegion = topLeft;
31
- ret = ReadConsoleOutputW(GetStdHandle(STD_OUTPUT_HANDLE), unicodeData,
32
- bufSize, bufCoord, &readRegion);
33
- assert(ret);
34
- readRegion = topLeft;
35
- ret = ReadConsoleOutputA(GetStdHandle(STD_OUTPUT_HANDLE), mbcsData,
36
- bufSize, bufCoord, &readRegion);
37
- assert(ret);
38
-
39
- printf("\n");
40
- for (int i = 0; i < w * h; ++i) {
41
- printf("(%02d,%02d) CHAR: %04x %4x -- %02x %4x\n",
42
- x + i % w, y + i / w,
43
- (unsigned short)unicodeData[i].Char.UnicodeChar,
44
- (unsigned short)unicodeData[i].Attributes,
45
- (unsigned char)mbcsData[i].Char.AsciiChar,
46
- (unsigned short)mbcsData[i].Attributes);
47
- }
48
- }
49
-
50
- int main(int argc, char *argv[]) {
51
- system("cls");
52
- setWindowPos(0, 0, 1, 1);
53
- setBufferSize(80, 38);
54
- setWindowPos(0, 0, 80, 38);
55
-
56
- // Write text.
57
- const wchar_t text1[] = {
58
- 0x3044, // U+3044 (HIRAGANA LETTER I)
59
- 0x2014, // U+2014 (EM DASH)
60
- 0x3044, // U+3044 (HIRAGANA LETTER I)
61
- 0xFF2D, // U+FF2D (FULLWIDTH LATIN CAPITAL LETTER M)
62
- 0x30FC, // U+30FC (KATAKANA-HIRAGANA PROLONGED SOUND MARK)
63
- 0x0031, // U+3031 (DIGIT ONE)
64
- 0x2014, // U+2014 (EM DASH)
65
- 0x0032, // U+0032 (DIGIT TWO)
66
- 0x005C, // U+005C (REVERSE SOLIDUS)
67
- 0x3044, // U+3044 (HIRAGANA LETTER I)
68
- 0
69
- };
70
- setCursorPos(0, 0);
71
- writeChars(text1);
72
-
73
- setCursorPos(78, 1);
74
- writeChars(L"<>");
75
-
76
- const wchar_t text2[] = {
77
- 0x0032, // U+3032 (DIGIT TWO)
78
- 0x3044, // U+3044 (HIRAGANA LETTER I)
79
- 0,
80
- };
81
- setCursorPos(78, 1);
82
- writeChars(text2);
83
-
84
- system("pause");
85
-
86
- dumpChars(0, 0, 17, 1);
87
- dumpChars(2, 0, 2, 1);
88
- dumpChars(2, 0, 1, 1);
89
- dumpChars(3, 0, 1, 1);
90
- dumpChars(78, 1, 2, 1);
91
- dumpChars(0, 2, 2, 1);
92
-
93
- system("pause");
94
- system("cls");
95
-
96
- const wchar_t text3[] = {
97
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 1
98
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 2
99
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 3
100
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 4
101
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 5
102
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 6
103
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 7
104
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 8
105
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 9
106
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 10
107
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 11
108
- 0x30FC, 0x30FC, 0x30FC, 0xFF2D, // 12
109
- L'\r', '\n',
110
- L'\r', '\n',
111
- 0
112
- };
113
- writeChars(text3);
114
- system("pause");
115
- {
116
- const COORD bufSize = {80, 2};
117
- const COORD bufCoord = {0, 0};
118
- SMALL_RECT readRegion = {0, 0, 79, 1};
119
- CHAR_INFO unicodeData[160];
120
- BOOL ret = ReadConsoleOutputW(GetStdHandle(STD_OUTPUT_HANDLE), unicodeData,
121
- bufSize, bufCoord, &readRegion);
122
- assert(ret);
123
- for (int i = 0; i < 96; ++i) {
124
- printf("%04x ", unicodeData[i].Char.UnicodeChar);
125
- }
126
- printf("\n");
127
- }
128
-
129
- return 0;
130
- }
@@ -1,89 +0,0 @@
1
- /*
2
- * Unix test code that puts the terminal into raw mode, then echos typed
3
- * characters to stdout. Derived from sample code in the Stevens book, posted
4
- * online at http://www.lafn.org/~dave/linux/terminalIO.html.
5
- */
6
-
7
- #include <termios.h>
8
- #include <unistd.h>
9
- #include <stdlib.h>
10
- #include <stdio.h>
11
- #include "FormatChar.h"
12
-
13
- static struct termios save_termios;
14
- static int term_saved;
15
-
16
- /* RAW! mode */
17
- int tty_raw(int fd)
18
- {
19
- struct termios buf;
20
-
21
- if (tcgetattr(fd, &save_termios) < 0) /* get the original state */
22
- return -1;
23
-
24
- buf = save_termios;
25
-
26
- /* echo off, canonical mode off, extended input
27
- processing off, signal chars off */
28
- buf.c_lflag &= ~(ECHO | ICANON | IEXTEN | ISIG);
29
-
30
- /* no SIGINT on BREAK, CR-to-NL off, input parity
31
- check off, don't strip the 8th bit on input,
32
- ouput flow control off */
33
- buf.c_iflag &= ~(BRKINT | ICRNL | ISTRIP | IXON);
34
-
35
- /* clear size bits, parity checking off */
36
- buf.c_cflag &= ~(CSIZE | PARENB);
37
-
38
- /* set 8 bits/char */
39
- buf.c_cflag |= CS8;
40
-
41
- /* output processing off */
42
- buf.c_oflag &= ~(OPOST);
43
-
44
- buf.c_cc[VMIN] = 1; /* 1 byte at a time */
45
- buf.c_cc[VTIME] = 0; /* no timer on input */
46
-
47
- if (tcsetattr(fd, TCSAFLUSH, &buf) < 0)
48
- return -1;
49
-
50
- term_saved = 1;
51
-
52
- return 0;
53
- }
54
-
55
-
56
- /* set it to normal! */
57
- int tty_reset(int fd)
58
- {
59
- if (term_saved)
60
- if (tcsetattr(fd, TCSAFLUSH, &save_termios) < 0)
61
- return -1;
62
-
63
- return 0;
64
- }
65
-
66
-
67
- int main()
68
- {
69
- tty_raw(0);
70
-
71
- int count = 0;
72
- while (true) {
73
- char ch;
74
- char buf[16];
75
- int actual = read(0, &ch, 1);
76
- if (actual != 1) {
77
- perror("read error");
78
- break;
79
- }
80
- formatChar(buf, ch);
81
- fputs(buf, stdout);
82
- fflush(stdout);
83
- if (ch == 3) // Ctrl-C
84
- break;
85
- }
86
-
87
- tty_reset(0);
88
- return 0;
89
- }
@@ -1,46 +0,0 @@
1
- #include <windows.h>
2
- #include <assert.h>
3
- #include <stdlib.h>
4
- #include <stdio.h>
5
-
6
- #include <vector>
7
- #include <string>
8
-
9
- int main(int argc, char *argv[]) {
10
- system("cls");
11
-
12
- if (argc == 1) {
13
- printf("Usage: %s hhhh\n", argv[0]);
14
- return 0;
15
- }
16
-
17
- std::wstring dataToWrite;
18
- for (int i = 1; i < argc; ++i) {
19
- wchar_t ch = strtol(argv[i], NULL, 16);
20
- dataToWrite.push_back(ch);
21
- }
22
-
23
- DWORD actual = 0;
24
- BOOL ret = WriteConsoleW(
25
- GetStdHandle(STD_OUTPUT_HANDLE),
26
- dataToWrite.data(), dataToWrite.size(), &actual, NULL);
27
- assert(ret && actual == dataToWrite.size());
28
-
29
- // Read it back.
30
- std::vector<CHAR_INFO> readBuffer(dataToWrite.size() * 2);
31
- COORD bufSize = {static_cast<short>(readBuffer.size()), 1};
32
- COORD bufCoord = {0, 0};
33
- SMALL_RECT topLeft = {0, 0, static_cast<short>(readBuffer.size() - 1), 0};
34
- ret = ReadConsoleOutputW(
35
- GetStdHandle(STD_OUTPUT_HANDLE), readBuffer.data(),
36
- bufSize, bufCoord, &topLeft);
37
- assert(ret);
38
-
39
- printf("\n");
40
- for (int i = 0; i < readBuffer.size(); ++i) {
41
- printf("CHAR: %04x %04x\n",
42
- readBuffer[i].Char.UnicodeChar,
43
- readBuffer[i].Attributes);
44
- }
45
- return 0;
46
- }