pinokiod 3.19.26 → 3.19.28
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 +9 -6
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -30,6 +30,7 @@ class Shell {
|
|
|
30
30
|
}
|
|
31
31
|
*/
|
|
32
32
|
constructor(kernel) {
|
|
33
|
+
this.EOL = os.EOL
|
|
33
34
|
this.kernel = kernel
|
|
34
35
|
this.platform = os.platform()
|
|
35
36
|
this.logs = {}
|
|
@@ -256,13 +257,15 @@ class Shell {
|
|
|
256
257
|
|
|
257
258
|
this.start_time = Date.now()
|
|
258
259
|
this.params = params
|
|
260
|
+
this.EOL = os.EOL
|
|
259
261
|
if (this.params.shell) {
|
|
260
262
|
this.shell = this.params.shell
|
|
261
263
|
if (/bash/i.test(this.shell)) {
|
|
262
264
|
this.args = ["--noprofile", "--norc"]
|
|
265
|
+
this.EOL = "\n"
|
|
263
266
|
}
|
|
264
267
|
}
|
|
265
|
-
console.log({ shell: this.shell, args: this.args, })
|
|
268
|
+
console.log({ shell: this.shell, args: this.args, eol: this.EOL })
|
|
266
269
|
|
|
267
270
|
// 3. path => path can be http, relative, absolute
|
|
268
271
|
this.path = params.path
|
|
@@ -382,14 +385,14 @@ class Shell {
|
|
|
382
385
|
this.cmd = this.build({ message: m })
|
|
383
386
|
this.ptyProcess.write(this.cmd)
|
|
384
387
|
if (newline) {
|
|
385
|
-
this.ptyProcess.write(
|
|
388
|
+
this.ptyProcess.write(this.EOL)
|
|
386
389
|
}
|
|
387
390
|
}
|
|
388
391
|
} else {
|
|
389
392
|
this.cmd = this.build({ message })
|
|
390
393
|
this.ptyProcess.write(this.cmd)
|
|
391
394
|
if (newline) {
|
|
392
|
-
this.ptyProcess.write(
|
|
395
|
+
this.ptyProcess.write(this.EOL)
|
|
393
396
|
}
|
|
394
397
|
}
|
|
395
398
|
})
|
|
@@ -404,12 +407,12 @@ class Shell {
|
|
|
404
407
|
for(let m of message) {
|
|
405
408
|
this.cmd = this.build({ message: m })
|
|
406
409
|
this.ptyProcess.write(this.cmd)
|
|
407
|
-
this.ptyProcess.write(
|
|
410
|
+
this.ptyProcess.write(this.EOL)
|
|
408
411
|
}
|
|
409
412
|
} else {
|
|
410
413
|
this.cmd = this.build({ message })
|
|
411
414
|
this.ptyProcess.write(this.cmd)
|
|
412
|
-
this.ptyProcess.write(
|
|
415
|
+
this.ptyProcess.write(this.EOL)
|
|
413
416
|
}
|
|
414
417
|
})
|
|
415
418
|
}
|
|
@@ -527,7 +530,7 @@ class Shell {
|
|
|
527
530
|
setTimeout(() => {
|
|
528
531
|
if (!ready) {
|
|
529
532
|
ready = true
|
|
530
|
-
term.write(`echo pinokio${
|
|
533
|
+
term.write(`echo pinokio${this.EOL}echo pinokio${this.EOL}`)
|
|
531
534
|
}
|
|
532
535
|
}, 500)
|
|
533
536
|
}
|