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.
- package/kernel/shell.js +16 -13
- 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.
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
this.prompt_ready
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
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
|
})
|