pinokiod 3.12.1 → 3.12.2
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 +10 -1
- package/package.json +1 -1
- package/server/socket.js +1 -0
- package/server/views/shell.ejs +3 -1
- package/server/views/terminal.ejs +5 -1
package/kernel/shell.js
CHANGED
|
@@ -37,7 +37,7 @@ class Shell {
|
|
|
37
37
|
|
|
38
38
|
// Windows: /D => ignore AutoRun Registry Key
|
|
39
39
|
// Others: --noprofile => ignore .bash_profile, --norc => ignore .bashrc
|
|
40
|
-
this.args = this.platform === 'win32' ? ["/D"] : ["--noprofile", "--norc"]
|
|
40
|
+
this.args = this.platform === 'win32' ? ["/D"] : ["--noprofile", "--norc",]
|
|
41
41
|
|
|
42
42
|
//this.vt = new Terminal({ allowProposedApi: true, scrollback: 5, })
|
|
43
43
|
// this.vt = new Terminal({
|
|
@@ -324,6 +324,7 @@ class Shell {
|
|
|
324
324
|
this.vt.resize(cols, rows)
|
|
325
325
|
}
|
|
326
326
|
emit2(message) {
|
|
327
|
+
console.log("emit2", message)
|
|
327
328
|
let i = 0;
|
|
328
329
|
const interval = setInterval(() => {
|
|
329
330
|
if (i >= message.length) {
|
|
@@ -331,6 +332,7 @@ class Shell {
|
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
334
|
let chunk = message.slice(i, i+1024)
|
|
335
|
+
console.log("chunk", i, chunk)
|
|
334
336
|
this.ptyProcess.write(chunk)
|
|
335
337
|
i += 1024;
|
|
336
338
|
}, 10);
|
|
@@ -341,6 +343,8 @@ class Shell {
|
|
|
341
343
|
} else {
|
|
342
344
|
if (this.ptyProcess) {
|
|
343
345
|
if (this.input) {
|
|
346
|
+
console.log("emit", { message })
|
|
347
|
+
console.log(Buffer.from(message))
|
|
344
348
|
this.ptyProcess.write(message)
|
|
345
349
|
}
|
|
346
350
|
}
|
|
@@ -929,6 +933,8 @@ class Shell {
|
|
|
929
933
|
this.done = false
|
|
930
934
|
this.ptyProcess = pty.spawn(this.shell, this.args, config)
|
|
931
935
|
this.ptyProcess.onData((data) => {
|
|
936
|
+
console.log("onData", { data })
|
|
937
|
+
console.log([...data].map(c => c.charCodeAt(0)));
|
|
932
938
|
if (!this.done) {
|
|
933
939
|
this.queue.push(data)
|
|
934
940
|
}
|
|
@@ -1160,6 +1166,9 @@ ${cleaned}
|
|
|
1160
1166
|
this.ready = true
|
|
1161
1167
|
if (this.ptyProcess) {
|
|
1162
1168
|
this.ptyProcess.write(`${this.cmd}${os.EOL}`)
|
|
1169
|
+
// setTimeout(() => {
|
|
1170
|
+
// this.ptyProcess.write('\x1B[?2004h');
|
|
1171
|
+
// }, 500)
|
|
1163
1172
|
}
|
|
1164
1173
|
}
|
|
1165
1174
|
}
|
package/package.json
CHANGED
package/server/socket.js
CHANGED
package/server/views/shell.ejs
CHANGED
|
@@ -662,8 +662,10 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
662
662
|
}
|
|
663
663
|
if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
664
664
|
navigator.clipboard.readText().then((text) => {
|
|
665
|
+
console.log({ text })
|
|
665
666
|
this.socket.run({
|
|
666
|
-
key: "\x1b[200~" + text + "\x1b[201~",
|
|
667
|
+
//key: "\x1b[200~" + text + "\x1b[201~",
|
|
668
|
+
key: text,
|
|
667
669
|
id: shell_id
|
|
668
670
|
})
|
|
669
671
|
})
|
|
@@ -688,8 +688,11 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
688
688
|
}
|
|
689
689
|
if ((event.ctrlKey || event.metaKey) && event.key === 'v') {
|
|
690
690
|
navigator.clipboard.readText().then((text) => {
|
|
691
|
+
console.log({ text })
|
|
692
|
+
debugger
|
|
691
693
|
this.socket.run({
|
|
692
|
-
key: "\x1b[200~" + text + "\x1b[201~",
|
|
694
|
+
//key: "\x1b[200~" + text + "\x1b[201~",
|
|
695
|
+
key: text,
|
|
693
696
|
id: shell_id
|
|
694
697
|
})
|
|
695
698
|
})
|
|
@@ -705,6 +708,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
705
708
|
//term.resize(cols, rows);
|
|
706
709
|
|
|
707
710
|
term.onKey(({ key }) => {
|
|
711
|
+
console.log({ key })
|
|
708
712
|
if (this.socket) {
|
|
709
713
|
if (shell_id) {
|
|
710
714
|
this.socket.run({
|