fix: add the PTY probe driver win32_input_matrix.ps1 launches

This commit is contained in:
kuddev committed 2026-08-09 15:17:53 +08:00
1 parent 6cb1120f53
commit 7a87e140a0
1 file changed
+16
+16
View File
@@ -0,0 +1,16 @@
// Probe side of scripts/win32_input_matrix.ps1 — runs as the PTY child inside
// Nebula, dumps every stdin chunk as hex. The driver injects a fixed key
// matrix via PostMessage and asserts the concatenated byte sequence against a
// recorded baseline. 'q' (0x71) terminates.
const fs = require('fs');
const out = process.argv[2] || 'D:\\temp_build\\nebula\\.tmp_win32_matrix.log';
const t0 = Date.now();
const log = (s) => fs.appendFileSync(out, `${((Date.now() - t0) / 1000).toFixed(1)}s ${s}\n`);
fs.writeFileSync(out, `matrix-probe ready node=${process.version} isTTY=${process.stdin.isTTY}\n`);
process.stdin.setRawMode(true);
process.stdin.resume();
process.stdin.on('data', (b) => {
log(`rx ${b.toString('hex')}`);
if (b.includes(0x71)) { log('end'); process.exit(0); }
});
setTimeout(() => { log('timeout'); process.exit(0); }, 90000);