pinokiod 3.19.32 → 3.19.34
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/kernel/shell.js +24 -21
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -502,27 +502,30 @@ class Shell {
|
|
|
502
502
|
vt.loadAddon(vts)
|
|
503
503
|
|
|
504
504
|
let queue = fastq((data, cb) => {
|
|
505
|
-
console.log("Vt.write", data)
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
.
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
505
|
+
console.log("Vt.write", { data, ready })
|
|
506
|
+
if (ready) {
|
|
507
|
+
vt.write(data, () => {
|
|
508
|
+
let buf = vts.serialize()
|
|
509
|
+
console.log({ buf })
|
|
510
|
+
let re = /(.+)echo pinokio[\r\n]+pinokio[\r\n]+(\1)/gs
|
|
511
|
+
const match = re.exec(buf)
|
|
512
|
+
console.log({ match })
|
|
513
|
+
if (match && match.length > 0) {
|
|
514
|
+
ready = false
|
|
515
|
+
let stripped = this.stripAnsi(match[1])
|
|
516
|
+
console.log({ stripped })
|
|
517
|
+
const p = stripped
|
|
518
|
+
.replaceAll(/[\r\n]/g, "")
|
|
519
|
+
.trim()
|
|
520
|
+
.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
521
|
+
term.kill()
|
|
522
|
+
vt.dispose()
|
|
523
|
+
queue.killAndDrain()
|
|
524
|
+
resolve(p)
|
|
525
|
+
}
|
|
526
|
+
})
|
|
527
|
+
cb()
|
|
528
|
+
}
|
|
526
529
|
}, 1)
|
|
527
530
|
term.onData((data) => {
|
|
528
531
|
console.log("Prompt onData", { data, ready })
|