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.
Files changed (2) hide show
  1. package/kernel/shell.js +24 -21
  2. 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
- vt.write(data, () => {
507
- let buf = vts.serialize()
508
- console.log({ buf })
509
- let re = /(.+)echo pinokio[\r\n]+pinokio[\r\n]+(\1)/gs
510
- const match = re.exec(buf)
511
- console.log({ match })
512
- if (match && match.length > 0) {
513
- let stripped = this.stripAnsi(match[1])
514
- console.log({ stripped })
515
- const p = stripped
516
- .replaceAll(/[\r\n]/g, "")
517
- .trim()
518
- .replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&');
519
- term.kill()
520
- vt.dispose()
521
- queue.killAndDrain()
522
- resolve(p)
523
- }
524
- })
525
- cb()
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 })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.19.32",
3
+ "version": "3.19.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {