node-pty 1.2.0-beta.5 → 1.2.0-beta.7
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.
- package/README.md +3 -5
- package/binding.gyp +0 -20
- package/lib/terminal.test.js +4 -4
- package/lib/terminal.test.js.map +1 -1
- package/lib/unixTerminal.test.js +16 -14
- package/lib/unixTerminal.test.js.map +1 -1
- package/lib/windowsPtyAgent.js +32 -95
- package/lib/windowsPtyAgent.js.map +1 -1
- package/lib/windowsTerminal.js +1 -1
- package/lib/windowsTerminal.js.map +1 -1
- package/lib/windowsTerminal.test.js +13 -14
- package/lib/windowsTerminal.test.js.map +1 -1
- package/package.json +1 -1
- package/prebuilds/darwin-arm64/pty.node +0 -0
- package/prebuilds/darwin-arm64/spawn-helper +0 -0
- package/prebuilds/darwin-x64/pty.node +0 -0
- package/prebuilds/darwin-x64/spawn-helper +0 -0
- package/prebuilds/win32-arm64/conpty.node +0 -0
- package/prebuilds/win32-arm64/conpty.pdb +0 -0
- package/prebuilds/win32-arm64/conpty_console_list.node +0 -0
- package/prebuilds/win32-arm64/conpty_console_list.pdb +0 -0
- package/prebuilds/win32-x64/conpty.node +0 -0
- package/prebuilds/win32-x64/conpty.pdb +0 -0
- package/prebuilds/win32-x64/conpty_console_list.node +0 -0
- package/prebuilds/win32-x64/conpty_console_list.pdb +0 -0
- package/scripts/post-install.js +1 -5
- package/src/interfaces.ts +8 -0
- package/src/native.d.ts +0 -17
- package/src/terminal.test.ts +4 -4
- package/src/unix/pty.cc +1 -1
- package/src/unixTerminal.test.ts +8 -4
- package/src/win/conpty.cc +1 -2
- package/src/windowsPtyAgent.ts +31 -91
- package/src/windowsTerminal.test.ts +13 -13
- package/src/windowsTerminal.ts +1 -1
- package/typings/node-pty.d.ts +9 -8
- package/deps/winpty/.drone.yml +0 -17
- package/deps/winpty/.gitattributes +0 -19
- package/deps/winpty/LICENSE +0 -21
- package/deps/winpty/Makefile +0 -166
- package/deps/winpty/README.md +0 -151
- package/deps/winpty/RELEASES.md +0 -280
- package/deps/winpty/VERSION.txt +0 -1
- package/deps/winpty/configure +0 -167
- package/deps/winpty/misc/BufferResizeTests.cc +0 -90
- package/deps/winpty/misc/ChangeScreenBuffer.cc +0 -53
- package/deps/winpty/misc/ClearConsole.cc +0 -72
- package/deps/winpty/misc/ConinMode.cc +0 -117
- package/deps/winpty/misc/ConinMode.ps1 +0 -116
- package/deps/winpty/misc/ConoutMode.cc +0 -113
- package/deps/winpty/misc/DebugClient.py +0 -42
- package/deps/winpty/misc/DebugServer.py +0 -63
- package/deps/winpty/misc/DumpLines.py +0 -5
- package/deps/winpty/misc/EnableExtendedFlags.txt +0 -46
- package/deps/winpty/misc/Font-Report-June2016/CP437-Consolas.txt +0 -528
- package/deps/winpty/misc/Font-Report-June2016/CP437-Lucida.txt +0 -633
- package/deps/winpty/misc/Font-Report-June2016/CP932.txt +0 -630
- package/deps/winpty/misc/Font-Report-June2016/CP936.txt +0 -630
- package/deps/winpty/misc/Font-Report-June2016/CP949.txt +0 -630
- package/deps/winpty/misc/Font-Report-June2016/CP950.txt +0 -630
- package/deps/winpty/misc/Font-Report-June2016/MinimumWindowWidths.txt +0 -16
- package/deps/winpty/misc/Font-Report-June2016/Results.txt +0 -4
- package/deps/winpty/misc/Font-Report-June2016/Windows10SetFontBugginess.txt +0 -144
- package/deps/winpty/misc/FontSurvey.cc +0 -100
- package/deps/winpty/misc/FormatChar.h +0 -21
- package/deps/winpty/misc/FreezePerfTest.cc +0 -62
- package/deps/winpty/misc/GetCh.cc +0 -20
- package/deps/winpty/misc/GetConsolePos.cc +0 -41
- package/deps/winpty/misc/GetFont.cc +0 -261
- package/deps/winpty/misc/IdentifyConsoleWindow.ps1 +0 -51
- package/deps/winpty/misc/IsNewConsole.cc +0 -87
- package/deps/winpty/misc/MouseInputNotes.txt +0 -90
- package/deps/winpty/misc/MoveConsoleWindow.cc +0 -34
- package/deps/winpty/misc/Notes.txt +0 -219
- package/deps/winpty/misc/OSVersion.cc +0 -27
- package/deps/winpty/misc/ScreenBufferFreezeInactive.cc +0 -101
- package/deps/winpty/misc/ScreenBufferTest.cc +0 -671
- package/deps/winpty/misc/ScreenBufferTest2.cc +0 -151
- package/deps/winpty/misc/SelectAllTest.cc +0 -45
- package/deps/winpty/misc/SetBufferSize.cc +0 -32
- package/deps/winpty/misc/SetCursorPos.cc +0 -10
- package/deps/winpty/misc/SetFont.cc +0 -145
- package/deps/winpty/misc/SetWindowRect.cc +0 -36
- package/deps/winpty/misc/ShowArgv.cc +0 -12
- package/deps/winpty/misc/ShowConsoleInput.cc +0 -40
- package/deps/winpty/misc/Spew.py +0 -5
- package/deps/winpty/misc/TestUtil.cc +0 -172
- package/deps/winpty/misc/UnicodeDoubleWidthTest.cc +0 -102
- package/deps/winpty/misc/UnicodeWideTest1.cc +0 -246
- package/deps/winpty/misc/UnicodeWideTest2.cc +0 -130
- package/deps/winpty/misc/UnixEcho.cc +0 -89
- package/deps/winpty/misc/Utf16Echo.cc +0 -46
- package/deps/winpty/misc/VeryLargeRead.cc +0 -122
- package/deps/winpty/misc/VkEscapeTest.cc +0 -56
- package/deps/winpty/misc/Win10ResizeWhileFrozen.cc +0 -52
- package/deps/winpty/misc/Win10WrapTest1.cc +0 -57
- package/deps/winpty/misc/Win10WrapTest2.cc +0 -30
- package/deps/winpty/misc/Win32Echo1.cc +0 -26
- package/deps/winpty/misc/Win32Echo2.cc +0 -19
- package/deps/winpty/misc/Win32Test1.cc +0 -46
- package/deps/winpty/misc/Win32Test2.cc +0 -70
- package/deps/winpty/misc/Win32Test3.cc +0 -78
- package/deps/winpty/misc/Win32Write1.cc +0 -44
- package/deps/winpty/misc/WindowsBugCrashReader.cc +0 -27
- package/deps/winpty/misc/WriteConsole.cc +0 -106
- package/deps/winpty/misc/build32.sh +0 -9
- package/deps/winpty/misc/build64.sh +0 -9
- package/deps/winpty/misc/color-test.sh +0 -212
- package/deps/winpty/misc/font-notes.txt +0 -300
- package/deps/winpty/misc/winbug-15048.cc +0 -201
- package/deps/winpty/ship/build-pty4j-libpty.bat +0 -36
- package/deps/winpty/ship/common_ship.py +0 -53
- package/deps/winpty/ship/make_msvc_package.py +0 -165
- package/deps/winpty/ship/ship.py +0 -108
- package/deps/winpty/src/agent/Agent.cc +0 -613
- package/deps/winpty/src/agent/Agent.h +0 -103
- package/deps/winpty/src/agent/AgentCreateDesktop.cc +0 -84
- package/deps/winpty/src/agent/AgentCreateDesktop.h +0 -28
- package/deps/winpty/src/agent/ConsoleFont.cc +0 -632
- package/deps/winpty/src/agent/ConsoleFont.h +0 -28
- package/deps/winpty/src/agent/ConsoleInput.cc +0 -852
- package/deps/winpty/src/agent/ConsoleInput.h +0 -109
- package/deps/winpty/src/agent/ConsoleInputReencoding.cc +0 -121
- package/deps/winpty/src/agent/ConsoleInputReencoding.h +0 -36
- package/deps/winpty/src/agent/ConsoleLine.cc +0 -152
- package/deps/winpty/src/agent/ConsoleLine.h +0 -41
- package/deps/winpty/src/agent/Coord.h +0 -87
- package/deps/winpty/src/agent/DebugShowInput.cc +0 -239
- package/deps/winpty/src/agent/DebugShowInput.h +0 -32
- package/deps/winpty/src/agent/DefaultInputMap.cc +0 -422
- package/deps/winpty/src/agent/DefaultInputMap.h +0 -28
- package/deps/winpty/src/agent/DsrSender.h +0 -30
- package/deps/winpty/src/agent/EventLoop.cc +0 -99
- package/deps/winpty/src/agent/EventLoop.h +0 -47
- package/deps/winpty/src/agent/InputMap.cc +0 -246
- package/deps/winpty/src/agent/InputMap.h +0 -114
- package/deps/winpty/src/agent/LargeConsoleRead.cc +0 -71
- package/deps/winpty/src/agent/LargeConsoleRead.h +0 -68
- package/deps/winpty/src/agent/NamedPipe.cc +0 -378
- package/deps/winpty/src/agent/NamedPipe.h +0 -125
- package/deps/winpty/src/agent/Scraper.cc +0 -699
- package/deps/winpty/src/agent/Scraper.h +0 -103
- package/deps/winpty/src/agent/SimplePool.h +0 -75
- package/deps/winpty/src/agent/SmallRect.h +0 -143
- package/deps/winpty/src/agent/Terminal.cc +0 -535
- package/deps/winpty/src/agent/Terminal.h +0 -69
- package/deps/winpty/src/agent/UnicodeEncoding.h +0 -157
- package/deps/winpty/src/agent/UnicodeEncodingTest.cc +0 -189
- package/deps/winpty/src/agent/Win32Console.cc +0 -107
- package/deps/winpty/src/agent/Win32Console.h +0 -67
- package/deps/winpty/src/agent/Win32ConsoleBuffer.cc +0 -193
- package/deps/winpty/src/agent/Win32ConsoleBuffer.h +0 -99
- package/deps/winpty/src/agent/main.cc +0 -114
- package/deps/winpty/src/agent/subdir.mk +0 -61
- package/deps/winpty/src/configurations.gypi +0 -60
- package/deps/winpty/src/debugserver/DebugServer.cc +0 -117
- package/deps/winpty/src/debugserver/subdir.mk +0 -41
- package/deps/winpty/src/include/winpty.h +0 -242
- package/deps/winpty/src/include/winpty_constants.h +0 -131
- package/deps/winpty/src/libwinpty/AgentLocation.cc +0 -75
- package/deps/winpty/src/libwinpty/AgentLocation.h +0 -28
- package/deps/winpty/src/libwinpty/LibWinptyException.h +0 -54
- package/deps/winpty/src/libwinpty/WinptyInternal.h +0 -72
- package/deps/winpty/src/libwinpty/subdir.mk +0 -46
- package/deps/winpty/src/libwinpty/winpty.cc +0 -970
- package/deps/winpty/src/shared/AgentMsg.h +0 -38
- package/deps/winpty/src/shared/BackgroundDesktop.cc +0 -122
- package/deps/winpty/src/shared/BackgroundDesktop.h +0 -73
- package/deps/winpty/src/shared/Buffer.cc +0 -103
- package/deps/winpty/src/shared/Buffer.h +0 -102
- package/deps/winpty/src/shared/DebugClient.cc +0 -187
- package/deps/winpty/src/shared/DebugClient.h +0 -38
- package/deps/winpty/src/shared/GenRandom.cc +0 -138
- package/deps/winpty/src/shared/GenRandom.h +0 -55
- package/deps/winpty/src/shared/GetCommitHash.bat +0 -13
- package/deps/winpty/src/shared/Mutex.h +0 -54
- package/deps/winpty/src/shared/OsModule.h +0 -63
- package/deps/winpty/src/shared/OwnedHandle.cc +0 -36
- package/deps/winpty/src/shared/OwnedHandle.h +0 -45
- package/deps/winpty/src/shared/PrecompiledHeader.h +0 -43
- package/deps/winpty/src/shared/StringBuilder.h +0 -227
- package/deps/winpty/src/shared/StringBuilderTest.cc +0 -114
- package/deps/winpty/src/shared/StringUtil.cc +0 -55
- package/deps/winpty/src/shared/StringUtil.h +0 -80
- package/deps/winpty/src/shared/TimeMeasurement.h +0 -63
- package/deps/winpty/src/shared/UnixCtrlChars.h +0 -45
- package/deps/winpty/src/shared/UpdateGenVersion.bat +0 -20
- package/deps/winpty/src/shared/WindowsSecurity.cc +0 -460
- package/deps/winpty/src/shared/WindowsSecurity.h +0 -104
- package/deps/winpty/src/shared/WindowsVersion.cc +0 -252
- package/deps/winpty/src/shared/WindowsVersion.h +0 -29
- package/deps/winpty/src/shared/WinptyAssert.cc +0 -55
- package/deps/winpty/src/shared/WinptyAssert.h +0 -64
- package/deps/winpty/src/shared/WinptyException.cc +0 -57
- package/deps/winpty/src/shared/WinptyException.h +0 -43
- package/deps/winpty/src/shared/WinptyVersion.cc +0 -42
- package/deps/winpty/src/shared/WinptyVersion.h +0 -27
- package/deps/winpty/src/shared/winpty_snprintf.h +0 -99
- package/deps/winpty/src/subdir.mk +0 -5
- package/deps/winpty/src/tests/subdir.mk +0 -28
- package/deps/winpty/src/tests/trivial_test.cc +0 -158
- package/deps/winpty/src/unix-adapter/InputHandler.cc +0 -114
- package/deps/winpty/src/unix-adapter/InputHandler.h +0 -56
- package/deps/winpty/src/unix-adapter/OutputHandler.cc +0 -80
- package/deps/winpty/src/unix-adapter/OutputHandler.h +0 -53
- package/deps/winpty/src/unix-adapter/Util.cc +0 -86
- package/deps/winpty/src/unix-adapter/Util.h +0 -31
- package/deps/winpty/src/unix-adapter/WakeupFd.cc +0 -70
- package/deps/winpty/src/unix-adapter/WakeupFd.h +0 -42
- package/deps/winpty/src/unix-adapter/main.cc +0 -729
- package/deps/winpty/src/unix-adapter/subdir.mk +0 -41
- package/deps/winpty/src/winpty.gyp +0 -236
- package/deps/winpty/vcbuild.bat +0 -83
- package/prebuilds/win32-arm64/pty.node +0 -0
- package/prebuilds/win32-arm64/pty.pdb +0 -0
- package/prebuilds/win32-arm64/winpty-agent.exe +0 -0
- package/prebuilds/win32-arm64/winpty-agent.pdb +0 -0
- package/prebuilds/win32-arm64/winpty.dll +0 -0
- package/prebuilds/win32-arm64/winpty.pdb +0 -0
- package/prebuilds/win32-x64/pty.node +0 -0
- package/prebuilds/win32-x64/pty.pdb +0 -0
- package/prebuilds/win32-x64/winpty-agent.exe +0 -0
- package/prebuilds/win32-x64/winpty-agent.pdb +0 -0
- package/prebuilds/win32-x64/winpty.dll +0 -0
- package/prebuilds/win32-x64/winpty.pdb +0 -0
- package/src/win/winpty.cc +0 -333
|
@@ -88,19 +88,18 @@ function pollForProcessTreeSize(pid, size, intervalMs, timeoutMs) {
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
if (process.platform === 'win32') {
|
|
91
|
-
[
|
|
92
|
-
|
|
93
|
-
describe("WindowsTerminal (useConpty = " + useConpty + ", useConptyDll = " + useConptyDll + ")", function () {
|
|
91
|
+
[false, true].forEach(function (useConptyDll) {
|
|
92
|
+
describe("WindowsTerminal (useConptyDll = " + useConptyDll + ")", function () {
|
|
94
93
|
describe('kill', function () {
|
|
95
94
|
it('should not crash parent process', function (done) {
|
|
96
95
|
this.timeout(20000);
|
|
97
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], {
|
|
96
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], { useConptyDll: useConptyDll });
|
|
98
97
|
term.on('exit', function () { return done(); });
|
|
99
98
|
term.kill();
|
|
100
99
|
});
|
|
101
100
|
it('should kill the process tree', function (done) {
|
|
102
101
|
this.timeout(20000);
|
|
103
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], {
|
|
102
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], { useConptyDll: useConptyDll });
|
|
104
103
|
// Start sub-processes
|
|
105
104
|
term.write('powershell.exe\r');
|
|
106
105
|
term.write('node.exe\r');
|
|
@@ -117,15 +116,15 @@ if (process.platform === 'win32') {
|
|
|
117
116
|
term.on('exit', function () {
|
|
118
117
|
pollForProcessState(desiredState, 1000, 5000).then(function () {
|
|
119
118
|
done();
|
|
120
|
-
});
|
|
119
|
+
}).catch(done);
|
|
121
120
|
});
|
|
122
|
-
});
|
|
121
|
+
}).catch(done);
|
|
123
122
|
});
|
|
124
123
|
});
|
|
125
124
|
describe('resize', function () {
|
|
126
125
|
it('should throw a non-native exception when resizing an invalid value', function (done) {
|
|
127
126
|
this.timeout(20000);
|
|
128
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], {
|
|
127
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], { useConptyDll: useConptyDll });
|
|
129
128
|
assert.throws(function () { return term.resize(-1, -1); });
|
|
130
129
|
assert.throws(function () { return term.resize(0, 0); });
|
|
131
130
|
assert.doesNotThrow(function () { return term.resize(1, 1); });
|
|
@@ -136,7 +135,7 @@ if (process.platform === 'win32') {
|
|
|
136
135
|
});
|
|
137
136
|
it('should throw a non-native exception when resizing a killed terminal', function (done) {
|
|
138
137
|
this.timeout(20000);
|
|
139
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], {
|
|
138
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', [], { useConptyDll: useConptyDll });
|
|
140
139
|
term._defer(function () {
|
|
141
140
|
term.once('exit', function () {
|
|
142
141
|
assert.throws(function () { return term.resize(1, 1); });
|
|
@@ -160,7 +159,7 @@ if (process.platform === 'win32') {
|
|
|
160
159
|
// Skip test if git bash isn't installed
|
|
161
160
|
return;
|
|
162
161
|
}
|
|
163
|
-
var term = new windowsTerminal_1.WindowsTerminal(cmdCopiedPath, '/c echo "hello world"', {
|
|
162
|
+
var term = new windowsTerminal_1.WindowsTerminal(cmdCopiedPath, '/c echo "hello world"', { useConptyDll: useConptyDll });
|
|
164
163
|
var result = '';
|
|
165
164
|
term.on('data', function (data) {
|
|
166
165
|
result += data;
|
|
@@ -174,7 +173,7 @@ if (process.platform === 'win32') {
|
|
|
174
173
|
describe('env', function () {
|
|
175
174
|
it('should set environment variables of the shell', function (done) {
|
|
176
175
|
this.timeout(10000);
|
|
177
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C echo %FOO%', {
|
|
176
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C echo %FOO%', { useConptyDll: useConptyDll, env: { FOO: 'BAR' } });
|
|
178
177
|
var result = '';
|
|
179
178
|
term.on('data', function (data) {
|
|
180
179
|
result += data;
|
|
@@ -188,7 +187,7 @@ if (process.platform === 'win32') {
|
|
|
188
187
|
describe('On close', function () {
|
|
189
188
|
it('should return process zero exit codes', function (done) {
|
|
190
189
|
this.timeout(10000);
|
|
191
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C exit', {
|
|
190
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C exit', { useConptyDll: useConptyDll });
|
|
192
191
|
term.on('exit', function (code) {
|
|
193
192
|
assert.strictEqual(code, 0);
|
|
194
193
|
done();
|
|
@@ -196,7 +195,7 @@ if (process.platform === 'win32') {
|
|
|
196
195
|
});
|
|
197
196
|
it('should return process non-zero exit codes', function (done) {
|
|
198
197
|
this.timeout(10000);
|
|
199
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C exit 2', {
|
|
198
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '/C exit 2', { useConptyDll: useConptyDll });
|
|
200
199
|
term.on('exit', function (code) {
|
|
201
200
|
assert.strictEqual(code, 2);
|
|
202
201
|
done();
|
|
@@ -206,7 +205,7 @@ if (process.platform === 'win32') {
|
|
|
206
205
|
describe('Write', function () {
|
|
207
206
|
it('should accept input', function (done) {
|
|
208
207
|
this.timeout(10000);
|
|
209
|
-
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '', {
|
|
208
|
+
var term = new windowsTerminal_1.WindowsTerminal('cmd.exe', '', { useConptyDll: useConptyDll });
|
|
210
209
|
term.write('exit\r');
|
|
211
210
|
term.on('exit', function () {
|
|
212
211
|
done();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windowsTerminal.test.js","sourceRoot":"","sources":["../src/windowsTerminal.test.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,uBAAyB;AACzB,+BAAiC;AACjC,qDAAoD;AACpD,2BAA6B;AAC7B,gCAAkC;AAYlC,SAAS,mBAAmB,CAAC,YAA2B,EAAE,UAAwB,EAAE,SAAwB;IAAlD,2BAAA,EAAA,gBAAwB;IAAE,0BAAA,EAAA,gBAAwB;IAC1G,OAAO,IAAI,OAAO,CAAO,UAAA,OAAO;QAC9B,IAAI,KAAK,GAAG,CAAC,CAAC;QACd,IAAM,QAAQ,GAAG,WAAW,CAAC;YAC3B,MAAM,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAA,EAAE;gBAC3B,IAAI,OAAO,GAAG,IAAI,CAAC;gBACnB,IAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,UAAA,CAAC,IAAI,OAAA,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,EAAf,CAAe,CAAC,CAAC;gBACjE,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;gBACnD,IAAI,CAAC,OAAO,CAAC,UAAA,GAAG;oBACd,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;wBACrB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,GAAG,KAAK,GAAG,EAAb,CAAa,CAAC,EAAE;4BAChC,OAAO,CAAC,GAAG,CAAC,SAAO,GAAG,oBAAiB,CAAC,CAAC;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AAC,CAAC,CAAC;wBAC5B,IAAI,EAAE,CAAC;oBACT,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,QAAQ,CAAC,OAAO,EAAE;gBAChB,EAAE,CAAC,qBAAqB,EAAE,UAAU,IAAI;oBACtC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;oBACpB,IAAM,IAAI,GAAG,IAAI,iCAAe,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,YAAY,cAAA,EAAE,CAAC,CAAC;oBAClE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;oBACrB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE;wBACd,IAAI,EAAE,CAAC;oBACT,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;CACJ"}
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/scripts/post-install.js
CHANGED
|
@@ -12,11 +12,7 @@ const BUILD_FILES = [
|
|
|
12
12
|
path.join(RELEASE_DIR, 'conpty_console_list.pdb'),
|
|
13
13
|
path.join(RELEASE_DIR, 'pty.node'),
|
|
14
14
|
path.join(RELEASE_DIR, 'pty.pdb'),
|
|
15
|
-
path.join(RELEASE_DIR, 'spawn-helper')
|
|
16
|
-
path.join(RELEASE_DIR, 'winpty-agent.exe'),
|
|
17
|
-
path.join(RELEASE_DIR, 'winpty-agent.pdb'),
|
|
18
|
-
path.join(RELEASE_DIR, 'winpty.dll'),
|
|
19
|
-
path.join(RELEASE_DIR, 'winpty.pdb')
|
|
15
|
+
path.join(RELEASE_DIR, 'spawn-helper')
|
|
20
16
|
];
|
|
21
17
|
const CONPTY_DIR = path.join(__dirname, '../third_party/conpty');
|
|
22
18
|
const CONPTY_SUPPORTED_ARCH = ['x64', 'arm64'];
|
package/src/interfaces.ts
CHANGED
|
@@ -118,6 +118,14 @@ export interface IPtyForkOptions extends IBasePtyForkOptions {
|
|
|
118
118
|
}
|
|
119
119
|
|
|
120
120
|
export interface IWindowsPtyForkOptions extends IBasePtyForkOptions {
|
|
121
|
+
/**
|
|
122
|
+
* Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when
|
|
123
|
+
* the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from
|
|
124
|
+
* build 17134 but is too unstable to enable by default.
|
|
125
|
+
*
|
|
126
|
+
* @deprecated This option is ignored and will be removed in a future version.
|
|
127
|
+
* https://github.com/microsoft/node-pty/issues/871
|
|
128
|
+
*/
|
|
121
129
|
useConpty?: boolean;
|
|
122
130
|
useConptyDll?: boolean;
|
|
123
131
|
conptyInheritCursor?: boolean;
|
package/src/native.d.ts
CHANGED
|
@@ -10,14 +10,6 @@ interface IConptyNative {
|
|
|
10
10
|
kill(ptyId: number, useConptyDll: boolean): void;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
interface IWinptyNative {
|
|
14
|
-
startProcess(file: string, commandLine: string, env: string[], cwd: string, cols: number, rows: number, debug: boolean): IWinptyProcess;
|
|
15
|
-
resize(pid: number, cols: number, rows: number): void;
|
|
16
|
-
kill(pid: number, innerPid: number): void;
|
|
17
|
-
getProcessList(pid: number): number[];
|
|
18
|
-
getExitCode(innerPid: number): number;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
13
|
interface IUnixNative {
|
|
22
14
|
fork(file: string, args: string[], parsedEnv: string[], cwd: string, cols: number, rows: number, uid: number, gid: number, useUtf8: boolean, helperPath: string, onExitCallback: (code: number, signal: number) => void): IUnixProcess;
|
|
23
15
|
open(cols: number, rows: number): IUnixOpenProcess;
|
|
@@ -32,15 +24,6 @@ interface IConptyProcess {
|
|
|
32
24
|
conout: string;
|
|
33
25
|
}
|
|
34
26
|
|
|
35
|
-
interface IWinptyProcess {
|
|
36
|
-
pty: number;
|
|
37
|
-
fd: number;
|
|
38
|
-
conin: string;
|
|
39
|
-
conout: string;
|
|
40
|
-
pid: number;
|
|
41
|
-
innerPid: number;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
27
|
interface IUnixProcess {
|
|
45
28
|
fd: number;
|
|
46
29
|
pid: number;
|
package/src/terminal.test.ts
CHANGED
|
@@ -4,15 +4,15 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as assert from 'assert';
|
|
7
|
-
import { WindowsTerminal } from './windowsTerminal';
|
|
8
|
-
import { UnixTerminal } from './unixTerminal';
|
|
9
7
|
import { Terminal } from './terminal';
|
|
10
8
|
import { Socket } from 'net';
|
|
11
9
|
|
|
12
|
-
const terminalConstructor = (process.platform === 'win32')
|
|
10
|
+
const terminalConstructor = (process.platform === 'win32')
|
|
11
|
+
? require('./windowsTerminal').WindowsTerminal
|
|
12
|
+
: require('./unixTerminal').UnixTerminal;
|
|
13
13
|
const SHELL = (process.platform === 'win32') ? 'cmd.exe' : '/bin/bash';
|
|
14
14
|
|
|
15
|
-
let terminalCtor: WindowsTerminal | UnixTerminal
|
|
15
|
+
let terminalCtor: any; // Will be WindowsTerminal | UnixTerminal depending on conditional report
|
|
16
16
|
if (process.platform === 'win32') {
|
|
17
17
|
terminalCtor = require('./windowsTerminal');
|
|
18
18
|
} else {
|
package/src/unix/pty.cc
CHANGED
|
@@ -131,7 +131,7 @@ SetCloseOnExec(int fd) {
|
|
|
131
131
|
static void
|
|
132
132
|
pty_close_inherited_fds() {
|
|
133
133
|
// Try close_range() first (Linux 5.9+, glibc 2.34+)
|
|
134
|
-
#if defined(SYS_close_range)
|
|
134
|
+
#if defined(SYS_close_range) && defined(CLOSE_RANGE_CLOEXEC)
|
|
135
135
|
if (syscall(SYS_close_range, 3, ~0U, CLOSE_RANGE_CLOEXEC) == 0) {
|
|
136
136
|
return;
|
|
137
137
|
}
|
package/src/unixTerminal.test.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
* Copyright (c) 2018, Microsoft Corporation (MIT License).
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import { UnixTerminal } from './unixTerminal';
|
|
7
6
|
import * as assert from 'assert';
|
|
8
7
|
import * as cp from 'child_process';
|
|
9
8
|
import * as path from 'path';
|
|
@@ -12,10 +11,15 @@ import * as fs from 'fs';
|
|
|
12
11
|
import { constants } from 'os';
|
|
13
12
|
import { pollUntil } from './testUtils.test';
|
|
14
13
|
import { pid } from 'process';
|
|
14
|
+
import type { UnixTerminal as UnixTerminalType } from './unixTerminal';
|
|
15
15
|
|
|
16
16
|
const FIXTURES_PATH = path.normalize(path.join(__dirname, '..', 'fixtures', 'utf8-character.txt'));
|
|
17
17
|
|
|
18
18
|
if (process.platform !== 'win32') {
|
|
19
|
+
// Dynamic require to avoid loading pty.node on Windows
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
21
|
+
const { UnixTerminal } = require('./unixTerminal') as { UnixTerminal: typeof UnixTerminalType };
|
|
22
|
+
|
|
19
23
|
describe('UnixTerminal', () => {
|
|
20
24
|
describe('Constructor', () => {
|
|
21
25
|
it('should set a valid pts name', () => {
|
|
@@ -75,7 +79,7 @@ if (process.platform !== 'win32') {
|
|
|
75
79
|
});
|
|
76
80
|
|
|
77
81
|
describe('open', () => {
|
|
78
|
-
let term:
|
|
82
|
+
let term: UnixTerminalType;
|
|
79
83
|
|
|
80
84
|
afterEach(() => {
|
|
81
85
|
if (term) {
|
|
@@ -259,7 +263,7 @@ if (process.platform !== 'win32') {
|
|
|
259
263
|
if (process.platform === 'linux') {
|
|
260
264
|
it('should not leak pty file descriptors to child processes', (done) => {
|
|
261
265
|
// Spawn 3 ptys - the 3rd should not see FDs from the first two
|
|
262
|
-
const ptys:
|
|
266
|
+
const ptys: UnixTerminalType[] = [];
|
|
263
267
|
for (let i = 0; i < 3; i++) {
|
|
264
268
|
ptys.push(new UnixTerminal('/bin/bash', [], {}));
|
|
265
269
|
}
|
|
@@ -348,7 +352,7 @@ if (process.platform !== 'win32') {
|
|
|
348
352
|
fs.statSync(`/proc/${sub}/fd/${readFd}`);
|
|
349
353
|
done('not reachable');
|
|
350
354
|
} catch (error) {
|
|
351
|
-
assert.notStrictEqual(error.message.indexOf('ENOENT'), -1);
|
|
355
|
+
assert.notStrictEqual((error as NodeJS.ErrnoException).message.indexOf('ENOENT'), -1);
|
|
352
356
|
}
|
|
353
357
|
setTimeout(() => {
|
|
354
358
|
process.kill(parseInt(sub), 'SIGINT'); // SIGINT to child
|
package/src/win/conpty.cc
CHANGED
|
@@ -230,7 +230,6 @@ HRESULT CreateNamedPipesAndPseudoConsole(const Napi::CallbackInfo& info,
|
|
|
230
230
|
{
|
|
231
231
|
// Failed to find CreatePseudoConsole in kernel32. This is likely because
|
|
232
232
|
// the user is not running a build of Windows that supports that API.
|
|
233
|
-
// We should fall back to winpty in this case.
|
|
234
233
|
return HRESULT_FROM_WIN32(GetLastError());
|
|
235
234
|
}
|
|
236
235
|
} else {
|
|
@@ -238,7 +237,7 @@ HRESULT CreateNamedPipesAndPseudoConsole(const Napi::CallbackInfo& info,
|
|
|
238
237
|
}
|
|
239
238
|
|
|
240
239
|
// Failed to find kernel32. This is realy unlikely - honestly no idea how
|
|
241
|
-
// this is even possible to hit.
|
|
240
|
+
// this is even possible to hit.
|
|
242
241
|
return HRESULT_FROM_WIN32(GetLastError());
|
|
243
242
|
}
|
|
244
243
|
|
package/src/windowsPtyAgent.ts
CHANGED
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as fs from 'fs';
|
|
8
|
-
import * as os from 'os';
|
|
9
8
|
import * as path from 'path';
|
|
10
9
|
import { fork } from 'child_process';
|
|
11
10
|
import { Socket } from 'net';
|
|
@@ -14,7 +13,6 @@ import { ConoutConnection } from './windowsConoutConnection';
|
|
|
14
13
|
import { loadNativeModule } from './utils';
|
|
15
14
|
|
|
16
15
|
let conptyNative: IConptyNative;
|
|
17
|
-
let winptyNative: IWinptyNative;
|
|
18
16
|
|
|
19
17
|
/**
|
|
20
18
|
* The amount of time to wait for additional data after the conpty shell process has exited before
|
|
@@ -24,13 +22,11 @@ let winptyNative: IWinptyNative;
|
|
|
24
22
|
const FLUSH_DATA_INTERVAL = 1000;
|
|
25
23
|
|
|
26
24
|
/**
|
|
27
|
-
* This agent sits between the WindowsTerminal class and provides
|
|
28
|
-
* and winpty.
|
|
25
|
+
* This agent sits between the WindowsTerminal class and provides an interface for conpty.
|
|
29
26
|
*/
|
|
30
27
|
export class WindowsPtyAgent {
|
|
31
28
|
private _inSocket: Socket;
|
|
32
29
|
private _outSocket: Socket;
|
|
33
|
-
private _pid: number = 0;
|
|
34
30
|
private _innerPid: number = 0;
|
|
35
31
|
private _closeTimeout: NodeJS.Timer | undefined;
|
|
36
32
|
private _exitCode: number | undefined;
|
|
@@ -38,7 +34,7 @@ export class WindowsPtyAgent {
|
|
|
38
34
|
|
|
39
35
|
private _fd: any;
|
|
40
36
|
private _pty: number;
|
|
41
|
-
private _ptyNative: IConptyNative
|
|
37
|
+
private _ptyNative: IConptyNative;
|
|
42
38
|
|
|
43
39
|
public get inSocket(): Socket { return this._inSocket; }
|
|
44
40
|
public get outSocket(): Socket { return this._outSocket; }
|
|
@@ -54,23 +50,13 @@ export class WindowsPtyAgent {
|
|
|
54
50
|
cols: number,
|
|
55
51
|
rows: number,
|
|
56
52
|
debug: boolean,
|
|
57
|
-
private _useConpty: boolean | undefined,
|
|
58
53
|
private _useConptyDll: boolean = false,
|
|
59
54
|
conptyInheritCursor: boolean = false
|
|
60
55
|
) {
|
|
61
|
-
if (
|
|
62
|
-
|
|
56
|
+
if (!conptyNative) {
|
|
57
|
+
conptyNative = loadNativeModule('conpty').module;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
|
-
if (!conptyNative) {
|
|
66
|
-
conptyNative = loadNativeModule('conpty').module;
|
|
67
|
-
}
|
|
68
|
-
} else {
|
|
69
|
-
if (!winptyNative) {
|
|
70
|
-
winptyNative = loadNativeModule('pty').module;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
this._ptyNative = this._useConpty ? conptyNative : winptyNative;
|
|
59
|
+
this._ptyNative = conptyNative;
|
|
74
60
|
|
|
75
61
|
// Sanitize input variable.
|
|
76
62
|
cwd = path.resolve(cwd);
|
|
@@ -79,14 +65,7 @@ export class WindowsPtyAgent {
|
|
|
79
65
|
const commandLine = argsToCommandLine(file, args);
|
|
80
66
|
|
|
81
67
|
// Open pty session.
|
|
82
|
-
|
|
83
|
-
if (this._useConpty) {
|
|
84
|
-
term = (this._ptyNative as IConptyNative).startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor, this._useConptyDll);
|
|
85
|
-
} else {
|
|
86
|
-
term = (this._ptyNative as IWinptyNative).startProcess(file, commandLine, env, cwd, cols, rows, debug);
|
|
87
|
-
this._pid = (term as IWinptyProcess).pid;
|
|
88
|
-
this._innerPid = (term as IWinptyProcess).innerPid;
|
|
89
|
-
}
|
|
68
|
+
const term: IConptyProcess = conptyNative.startProcess(file, cols, rows, debug, this._generatePipeName(), conptyInheritCursor, this._useConptyDll);
|
|
90
69
|
|
|
91
70
|
// Not available on windows.
|
|
92
71
|
this._fd = term.fd;
|
|
@@ -115,69 +94,43 @@ export class WindowsPtyAgent {
|
|
|
115
94
|
});
|
|
116
95
|
this._inSocket.setEncoding('utf8');
|
|
117
96
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
this._innerPid = connect.pid;
|
|
121
|
-
}
|
|
97
|
+
const connect = conptyNative.connect(this._pty, commandLine, cwd, env, this._useConptyDll, c => this._$onProcessExit(c));
|
|
98
|
+
this._innerPid = connect.pid;
|
|
122
99
|
}
|
|
123
100
|
|
|
124
101
|
public resize(cols: number, rows: number): void {
|
|
125
|
-
if (this.
|
|
126
|
-
|
|
127
|
-
throw new Error('Cannot resize a pty that has already exited');
|
|
128
|
-
}
|
|
129
|
-
(this._ptyNative as IConptyNative).resize(this._pty, cols, rows, this._useConptyDll);
|
|
130
|
-
return;
|
|
102
|
+
if (this._exitCode !== undefined) {
|
|
103
|
+
throw new Error('Cannot resize a pty that has already exited');
|
|
131
104
|
}
|
|
132
|
-
|
|
105
|
+
this._ptyNative.resize(this._pty, cols, rows, this._useConptyDll);
|
|
133
106
|
}
|
|
134
107
|
|
|
135
108
|
public clear(): void {
|
|
136
|
-
|
|
137
|
-
(this._ptyNative as IConptyNative).clear(this._pty, this._useConptyDll);
|
|
138
|
-
}
|
|
109
|
+
this._ptyNative.clear(this._pty, this._useConptyDll);
|
|
139
110
|
}
|
|
140
111
|
|
|
141
112
|
public kill(): void {
|
|
142
113
|
// Tell the agent to kill the pty, this releases handles to the process
|
|
143
|
-
if (this.
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
});
|
|
156
|
-
(this._ptyNative as IConptyNative).kill(this._pty, this._useConptyDll);
|
|
157
|
-
this._conoutSocketWorker.dispose();
|
|
158
|
-
} else {
|
|
159
|
-
// Close the input write handle to signal the end of session.
|
|
160
|
-
this._inSocket.destroy();
|
|
161
|
-
(this._ptyNative as IConptyNative).kill(this._pty, this._useConptyDll);
|
|
162
|
-
this._outSocket.on('data', () => {
|
|
163
|
-
this._conoutSocketWorker.dispose();
|
|
114
|
+
if (!this._useConptyDll) {
|
|
115
|
+
this._inSocket.readable = false;
|
|
116
|
+
this._outSocket.readable = false;
|
|
117
|
+
this._getConsoleProcessList().then(consoleProcessList => {
|
|
118
|
+
consoleProcessList.forEach((pid: number) => {
|
|
119
|
+
try {
|
|
120
|
+
process.kill(pid);
|
|
121
|
+
} catch (e) {
|
|
122
|
+
// Ignore if process cannot be found (kill ESRCH error)
|
|
123
|
+
}
|
|
164
124
|
});
|
|
165
|
-
}
|
|
125
|
+
});
|
|
126
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
127
|
+
this._conoutSocketWorker.dispose();
|
|
166
128
|
} else {
|
|
167
|
-
//
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
// Microsoft/vscode#26807).
|
|
173
|
-
const processList: number[] = (this._ptyNative as IWinptyNative).getProcessList(this._pid);
|
|
174
|
-
(this._ptyNative as IWinptyNative).kill(this._pid, this._innerPid);
|
|
175
|
-
processList.forEach(pid => {
|
|
176
|
-
try {
|
|
177
|
-
process.kill(pid);
|
|
178
|
-
} catch (e) {
|
|
179
|
-
// Ignore if process cannot be found (kill ESRCH error)
|
|
180
|
-
}
|
|
129
|
+
// Close the input write handle to signal the end of session.
|
|
130
|
+
this._inSocket.destroy();
|
|
131
|
+
this._ptyNative.kill(this._pty, this._useConptyDll);
|
|
132
|
+
this._outSocket.on('data', () => {
|
|
133
|
+
this._conoutSocketWorker.dispose();
|
|
181
134
|
});
|
|
182
135
|
}
|
|
183
136
|
}
|
|
@@ -198,20 +151,7 @@ export class WindowsPtyAgent {
|
|
|
198
151
|
}
|
|
199
152
|
|
|
200
153
|
public get exitCode(): number | undefined {
|
|
201
|
-
|
|
202
|
-
return this._exitCode;
|
|
203
|
-
}
|
|
204
|
-
const winptyExitCode = (this._ptyNative as IWinptyNative).getExitCode(this._innerPid);
|
|
205
|
-
return winptyExitCode === -1 ? undefined : winptyExitCode;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
private _getWindowsBuildNumber(): number {
|
|
209
|
-
const osVersion = (/(\d+)\.(\d+)\.(\d+)/g).exec(os.release());
|
|
210
|
-
let buildNumber: number = 0;
|
|
211
|
-
if (osVersion && osVersion.length === 4) {
|
|
212
|
-
buildNumber = parseInt(osVersion[3]);
|
|
213
|
-
}
|
|
214
|
-
return buildNumber;
|
|
154
|
+
return this._exitCode;
|
|
215
155
|
}
|
|
216
156
|
|
|
217
157
|
private _generatePipeName(): string {
|
|
@@ -92,18 +92,18 @@ function pollForProcessTreeSize(pid: number, size: number, intervalMs: number =
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
if (process.platform === 'win32') {
|
|
95
|
-
[
|
|
96
|
-
describe(`WindowsTerminal (
|
|
95
|
+
[false, true].forEach((useConptyDll) => {
|
|
96
|
+
describe(`WindowsTerminal (useConptyDll = ${useConptyDll})`, () => {
|
|
97
97
|
describe('kill', () => {
|
|
98
98
|
it('should not crash parent process', function (done) {
|
|
99
99
|
this.timeout(20000);
|
|
100
|
-
const term = new WindowsTerminal('cmd.exe', [], {
|
|
100
|
+
const term = new WindowsTerminal('cmd.exe', [], { useConptyDll });
|
|
101
101
|
term.on('exit', () => done());
|
|
102
102
|
term.kill();
|
|
103
103
|
});
|
|
104
104
|
it('should kill the process tree', function (done: Mocha.Done): void {
|
|
105
105
|
this.timeout(20000);
|
|
106
|
-
const term = new WindowsTerminal('cmd.exe', [], {
|
|
106
|
+
const term = new WindowsTerminal('cmd.exe', [], { useConptyDll });
|
|
107
107
|
// Start sub-processes
|
|
108
108
|
term.write('powershell.exe\r');
|
|
109
109
|
term.write('node.exe\r');
|
|
@@ -120,16 +120,16 @@ if (process.platform === 'win32') {
|
|
|
120
120
|
term.on('exit', () => {
|
|
121
121
|
pollForProcessState(desiredState, 1000, 5000).then(() => {
|
|
122
122
|
done();
|
|
123
|
-
});
|
|
123
|
+
}).catch(done);
|
|
124
124
|
});
|
|
125
|
-
});
|
|
125
|
+
}).catch(done);
|
|
126
126
|
});
|
|
127
127
|
});
|
|
128
128
|
|
|
129
129
|
describe('resize', () => {
|
|
130
130
|
it('should throw a non-native exception when resizing an invalid value', function(done) {
|
|
131
131
|
this.timeout(20000);
|
|
132
|
-
const term = new WindowsTerminal('cmd.exe', [], {
|
|
132
|
+
const term = new WindowsTerminal('cmd.exe', [], { useConptyDll });
|
|
133
133
|
assert.throws(() => term.resize(-1, -1));
|
|
134
134
|
assert.throws(() => term.resize(0, 0));
|
|
135
135
|
assert.doesNotThrow(() => term.resize(1, 1));
|
|
@@ -140,7 +140,7 @@ if (process.platform === 'win32') {
|
|
|
140
140
|
});
|
|
141
141
|
it('should throw a non-native exception when resizing a killed terminal', function(done) {
|
|
142
142
|
this.timeout(20000);
|
|
143
|
-
const term = new WindowsTerminal('cmd.exe', [], {
|
|
143
|
+
const term = new WindowsTerminal('cmd.exe', [], { useConptyDll });
|
|
144
144
|
(<any>term)._defer(() => {
|
|
145
145
|
term.once('exit', () => {
|
|
146
146
|
assert.throws(() => term.resize(1, 1));
|
|
@@ -167,7 +167,7 @@ if (process.platform === 'win32') {
|
|
|
167
167
|
// Skip test if git bash isn't installed
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const term = new WindowsTerminal(cmdCopiedPath, '/c echo "hello world"', {
|
|
170
|
+
const term = new WindowsTerminal(cmdCopiedPath, '/c echo "hello world"', { useConptyDll });
|
|
171
171
|
let result = '';
|
|
172
172
|
term.on('data', (data) => {
|
|
173
173
|
result += data;
|
|
@@ -182,7 +182,7 @@ if (process.platform === 'win32') {
|
|
|
182
182
|
describe('env', () => {
|
|
183
183
|
it('should set environment variables of the shell', function (done) {
|
|
184
184
|
this.timeout(10000);
|
|
185
|
-
const term = new WindowsTerminal('cmd.exe', '/C echo %FOO%', {
|
|
185
|
+
const term = new WindowsTerminal('cmd.exe', '/C echo %FOO%', { useConptyDll, env: { FOO: 'BAR' }});
|
|
186
186
|
let result = '';
|
|
187
187
|
term.on('data', (data) => {
|
|
188
188
|
result += data;
|
|
@@ -197,7 +197,7 @@ if (process.platform === 'win32') {
|
|
|
197
197
|
describe('On close', () => {
|
|
198
198
|
it('should return process zero exit codes', function (done) {
|
|
199
199
|
this.timeout(10000);
|
|
200
|
-
const term = new WindowsTerminal('cmd.exe', '/C exit', {
|
|
200
|
+
const term = new WindowsTerminal('cmd.exe', '/C exit', { useConptyDll });
|
|
201
201
|
term.on('exit', (code) => {
|
|
202
202
|
assert.strictEqual(code, 0);
|
|
203
203
|
done();
|
|
@@ -206,7 +206,7 @@ if (process.platform === 'win32') {
|
|
|
206
206
|
|
|
207
207
|
it('should return process non-zero exit codes', function (done) {
|
|
208
208
|
this.timeout(10000);
|
|
209
|
-
const term = new WindowsTerminal('cmd.exe', '/C exit 2', {
|
|
209
|
+
const term = new WindowsTerminal('cmd.exe', '/C exit 2', { useConptyDll });
|
|
210
210
|
term.on('exit', (code) => {
|
|
211
211
|
assert.strictEqual(code, 2);
|
|
212
212
|
done();
|
|
@@ -217,7 +217,7 @@ if (process.platform === 'win32') {
|
|
|
217
217
|
describe('Write', () => {
|
|
218
218
|
it('should accept input', function (done) {
|
|
219
219
|
this.timeout(10000);
|
|
220
|
-
const term = new WindowsTerminal('cmd.exe', '', {
|
|
220
|
+
const term = new WindowsTerminal('cmd.exe', '', { useConptyDll });
|
|
221
221
|
term.write('exit\r');
|
|
222
222
|
term.on('exit', () => {
|
|
223
223
|
done();
|
package/src/windowsTerminal.ts
CHANGED
|
@@ -48,7 +48,7 @@ export class WindowsTerminal extends Terminal {
|
|
|
48
48
|
this._deferreds = [];
|
|
49
49
|
|
|
50
50
|
// Create new termal.
|
|
51
|
-
this._agent = new WindowsPtyAgent(file, args, parsedEnv, cwd, this._cols, this._rows, false, opt.
|
|
51
|
+
this._agent = new WindowsPtyAgent(file, args, parsedEnv, cwd, this._cols, this._rows, false, opt.useConptyDll, opt.conptyInheritCursor);
|
|
52
52
|
this._socket = this._agent.outSocket;
|
|
53
53
|
|
|
54
54
|
// Not available until `ready` event emitted.
|