Skip to content

Commit a2d27fe

Browse files
committed
fixed node-pty conpty assertion failure - fixes #10618
1 parent b9e3358 commit a2d27fe

File tree

3 files changed

+226
-59
lines changed

3 files changed

+226
-59
lines changed

app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
"optionalDependencies": {
3939
"@tabby-gang/windows-blurbehind": "^3.1.0",
4040
"macos-native-processlist": "^2.1.0",
41-
"patch-package": "^6.5.0",
41+
"patch-package": "^8",
4242
"serialport": "11.0.1",
4343
"serialport-binding-webserialapi": "^1.0.3",
4444
"windows-native-registry": "^3.2.1",
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/node_modules/node-pty/src/win/conpty.cc b/node_modules/node-pty/src/win/conpty.cc
2+
index c41796c..08c6439 100644
3+
--- a/node_modules/node-pty/src/win/conpty.cc
4+
+++ b/node_modules/node-pty/src/win/conpty.cc
5+
@@ -107,9 +107,22 @@ void SetupExitCallback(Napi::Env env, Napi::Function cb, pty_baton* baton) {
6+
CloseHandle(baton->hOut);
7+
8+
auto status = tsfn.BlockingCall(exit_event, callback); // In main thread
9+
- assert(status == napi_ok);
10+
+ switch (status) {
11+
+ case napi_closing:
12+
+ break;
13+
14+
- tsfn.Release();
15+
+ case napi_queue_full:
16+
+ Napi::Error::Fatal("SetupExitCallback", "Queue was full");
17+
+
18+
+ case napi_ok:
19+
+ if (tsfn.Release() != napi_ok) {
20+
+ Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.Release() failed");
21+
+ }
22+
+ break;
23+
+
24+
+ default:
25+
+ Napi::Error::Fatal("SetupExitCallback", "ThreadSafeFunction.BlockingCall() failed");
26+
+ }
27+
});
28+
}
29+

0 commit comments

Comments
 (0)