pinokiod 3.19.35 → 3.19.37
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 +19 -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
|
})
|
|
@@ -972,7 +975,9 @@ class Shell {
|
|
|
972
975
|
}
|
|
973
976
|
async exec(params) {
|
|
974
977
|
params = await this.activate(params)
|
|
978
|
+
console.log("#Exec 1", { params })
|
|
975
979
|
this.cmd = this.build(params)
|
|
980
|
+
console.log("#Exec 2", { cmd: this.cmd })
|
|
976
981
|
let res = await new Promise((resolve, reject) => {
|
|
977
982
|
this.resolve = resolve
|
|
978
983
|
this.reject = reject
|
|
@@ -1249,6 +1254,7 @@ ${cleaned}
|
|
|
1249
1254
|
this.params.onready()
|
|
1250
1255
|
}
|
|
1251
1256
|
if (this.ptyProcess) {
|
|
1257
|
+
console.log("ptyProcess.write", { cmd: this.cmd, eol: this.EOL })
|
|
1252
1258
|
this.ptyProcess.write(`${this.cmd}${this.EOL}`)
|
|
1253
1259
|
// setTimeout(() => {
|
|
1254
1260
|
// this.ptyProcess.write('\x1B[?2004h');
|