@opencrater/sdk 0.8.51 → 0.8.53
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.
Potentially problematic release.
This version of @opencrater/sdk might be problematic. Click here for more details.
- package/dist/paint.js +17 -3
- package/package.json +1 -1
package/dist/paint.js
CHANGED
|
@@ -351,7 +351,7 @@ function spawnWindowsConsoleSink() {
|
|
|
351
351
|
pdebug("spawning pump:", exe);
|
|
352
352
|
const child = child_process.spawn(exe, ["-NoProfile", "-NonInteractive", "-EncodedCommand", b64], {
|
|
353
353
|
stdio: ["pipe", "pipe", errStdio],
|
|
354
|
-
windowsHide:
|
|
354
|
+
windowsHide: true
|
|
355
355
|
});
|
|
356
356
|
child.on("error", (e) => pdebug("pump spawn error:", exe, "-", e.message));
|
|
357
357
|
child.on("exit", (code) => pdebug("pump process exited code", code, "pid", child.pid));
|
|
@@ -430,7 +430,7 @@ function spawnWindowsConsoleSink() {
|
|
|
430
430
|
function wmiSpawnDetached(cmdLine) {
|
|
431
431
|
try {
|
|
432
432
|
const esc = cmdLine.replace(/'/g, "''");
|
|
433
|
-
const ps = `$ErrorActionPreference='Stop';try{$r=Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine='${esc}'};if($r.ReturnValue -eq 0){[Console]::Out.Write('OCPID '+$r.ProcessId)}else{[Console]::Out.Write('OCERR rv='+$r.ReturnValue)}}catch{[Console]::Out.Write('OCERR '+$_.Exception.Message)}`;
|
|
433
|
+
const ps = `$ErrorActionPreference='Stop';try{$su=New-CimInstance -ClassName Win32_ProcessStartup -ClientOnly -Property @{CreateFlags=[uint32]134217728;ShowWindow=[uint16]0};$r=Invoke-CimMethod -ClassName Win32_Process -MethodName Create -Arguments @{CommandLine='${esc}';ProcessStartupInformation=$su};if($r.ReturnValue -eq 0){[Console]::Out.Write('OCPID '+$r.ProcessId)}else{[Console]::Out.Write('OCERR rv='+$r.ReturnValue)}}catch{[Console]::Out.Write('OCERR '+$_.Exception.Message)}`;
|
|
434
434
|
const b64 = Buffer.from(ps, "utf16le").toString("base64");
|
|
435
435
|
const res = child_process.spawnSync(
|
|
436
436
|
powershellPath(),
|
|
@@ -1164,6 +1164,18 @@ function main() {
|
|
|
1164
1164
|
}
|
|
1165
1165
|
clear();
|
|
1166
1166
|
releaseLock();
|
|
1167
|
+
if (IS_WINDOWS) {
|
|
1168
|
+
let gone = false;
|
|
1169
|
+
const bye = () => {
|
|
1170
|
+
if (!gone) {
|
|
1171
|
+
gone = true;
|
|
1172
|
+
process.exit(0);
|
|
1173
|
+
}
|
|
1174
|
+
};
|
|
1175
|
+
void sink.closeAndWait().then(bye);
|
|
1176
|
+
setTimeout(bye, 1500).unref?.();
|
|
1177
|
+
return;
|
|
1178
|
+
}
|
|
1167
1179
|
sink.close();
|
|
1168
1180
|
process.exit(0);
|
|
1169
1181
|
};
|
|
@@ -1298,7 +1310,7 @@ function main() {
|
|
|
1298
1310
|
args.push(file);
|
|
1299
1311
|
}
|
|
1300
1312
|
try {
|
|
1301
|
-
audioProc = child_process.spawn(cmd, args, { stdio: "ignore" });
|
|
1313
|
+
audioProc = IS_WINDOWS ? child_process.spawn(cmd, args, { stdio: "ignore", detached: true, windowsHide: true }) : child_process.spawn(cmd, args, { stdio: "ignore" });
|
|
1302
1314
|
audioState = "playing";
|
|
1303
1315
|
audioStartedAt = Date.now();
|
|
1304
1316
|
audioProc.on("exit", () => {
|
|
@@ -1455,10 +1467,12 @@ function main() {
|
|
|
1455
1467
|
} catch {
|
|
1456
1468
|
}
|
|
1457
1469
|
}
|
|
1470
|
+
takeOverLock(sink);
|
|
1458
1471
|
const framesNow = ansiFrames;
|
|
1459
1472
|
const animated = !!(framesNow && framesNow.length > 1);
|
|
1460
1473
|
paint();
|
|
1461
1474
|
interval = setInterval(paint, animated ? ANIM_MS : REPAINT_MS);
|
|
1475
|
+
startActivityWatch();
|
|
1462
1476
|
setTimeout(() => cleanup(), duration2);
|
|
1463
1477
|
return;
|
|
1464
1478
|
}
|