pinokiod 3.19.35 → 3.19.36

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 +16 -13
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -501,7 +501,7 @@ class Shell {
501
501
  vt.loadAddon(vts)
502
502
 
503
503
  let queue = fastq((data, cb) => {
504
- console.log("Vt.write", { data, prompt_ready: this.prompt_ready })
504
+ console.log("Vt.write", { data, prompt_ready: this.prompt_ready, prompt_done: this.prompt_done })
505
505
  if (this.prompt_ready) {
506
506
  vt.write(data, () => {
507
507
  let buf = vts.serialize()
@@ -511,8 +511,9 @@ class Shell {
511
511
  console.log({ match })
512
512
  if (match && match.length > 0) {
513
513
  this.prompt_ready = false
514
+ this.prompt_done = true
514
515
  let stripped = this.stripAnsi(match[1])
515
- console.log({ stripped, prompt_ready: this.prompt_ready })
516
+ console.log({ stripped, prompt_ready: this.prompt_ready, prompt_done: this.prompt_done })
516
517
  const p = stripped
517
518
  .replaceAll(/[\r\n]/g, "")
518
519
  .trim()
@@ -527,17 +528,19 @@ class Shell {
527
528
  }
528
529
  }, 1)
529
530
  term.onData((data) => {
530
- console.log("Prompt onData", { data, prompt_ready: this.prompt_ready })
531
- if (this.prompt_ready) {
532
- queue.push(data)
533
- } else {
534
- setTimeout(() => {
535
- if (!this.prompt_ready) {
536
- this.prompt_ready = true
537
- console.log("P", { eol: this.EOL, shell: this.shell, args: this.args, prompt_ready: this.prompt_ready })
538
- term.write(`echo pinokio${this.EOL}echo pinokio${this.EOL}`)
539
- }
540
- }, 500)
531
+ console.log("Prompt onData", { data, prompt_ready: this.prompt_ready, prompt_done: this.prompt_done })
532
+ if (!this.prompt_done) {
533
+ if (this.prompt_ready) {
534
+ queue.push(data)
535
+ } else {
536
+ setTimeout(() => {
537
+ if (!this.prompt_ready) {
538
+ this.prompt_ready = true
539
+ console.log("P", { eol: this.EOL, shell: this.shell, args: this.args, prompt_ready: this.prompt_ready })
540
+ term.write(`echo pinokio${this.EOL}echo pinokio${this.EOL}`)
541
+ }
542
+ }, 500)
543
+ }
541
544
  }
542
545
  });
543
546
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.19.35",
3
+ "version": "3.19.36",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {