pinokiod 3.0.25 → 3.0.26
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 -0
- package/package.json +1 -1
- package/server/index.js +20 -0
- package/server/views/editor.ejs +11 -26
- package/server/views/fullscreen_editor.ejs +11 -26
package/kernel/shell.js
CHANGED
|
@@ -540,6 +540,8 @@ class Shell {
|
|
|
540
540
|
conda_activation = [
|
|
541
541
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
542
542
|
`conda deactivate`,
|
|
543
|
+
`conda deactivate`,
|
|
544
|
+
`conda deactivate`,
|
|
543
545
|
`conda activate ${env_path}`,
|
|
544
546
|
]
|
|
545
547
|
} else {
|
|
@@ -547,6 +549,8 @@ class Shell {
|
|
|
547
549
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
548
550
|
`conda create -y -p ${env_path} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
549
551
|
`conda deactivate`,
|
|
552
|
+
`conda deactivate`,
|
|
553
|
+
`conda deactivate`,
|
|
550
554
|
`conda activate ${env_path}`,
|
|
551
555
|
]
|
|
552
556
|
}
|
|
@@ -555,6 +559,8 @@ class Shell {
|
|
|
555
559
|
conda_activation = [
|
|
556
560
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
557
561
|
`conda deactivate`,
|
|
562
|
+
`conda deactivate`,
|
|
563
|
+
`conda deactivate`,
|
|
558
564
|
`conda activate ${conda_name}`,
|
|
559
565
|
]
|
|
560
566
|
} else {
|
|
@@ -565,6 +571,8 @@ class Shell {
|
|
|
565
571
|
conda_activation = [
|
|
566
572
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
567
573
|
`conda deactivate`,
|
|
574
|
+
`conda deactivate`,
|
|
575
|
+
`conda deactivate`,
|
|
568
576
|
`conda activate ${conda_name}`,
|
|
569
577
|
]
|
|
570
578
|
} else {
|
|
@@ -572,6 +580,8 @@ class Shell {
|
|
|
572
580
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
573
581
|
`conda create -y -n ${conda_name} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
574
582
|
`conda deactivate`,
|
|
583
|
+
`conda deactivate`,
|
|
584
|
+
`conda deactivate`,
|
|
575
585
|
`conda activate ${conda_name}`,
|
|
576
586
|
]
|
|
577
587
|
}
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -1323,6 +1323,10 @@ class Server {
|
|
|
1323
1323
|
if (config.color) this.colors.color = config.color
|
|
1324
1324
|
if (config.symbolColor) this.colors.symbolColor = config.symbolColor
|
|
1325
1325
|
}
|
|
1326
|
+
if (config.xterm) {
|
|
1327
|
+
this.xterm = config.xterm
|
|
1328
|
+
console.log("this.xterm", this.xterm)
|
|
1329
|
+
}
|
|
1326
1330
|
}
|
|
1327
1331
|
}
|
|
1328
1332
|
}
|
|
@@ -2670,6 +2674,22 @@ class Server {
|
|
|
2670
2674
|
agent: this.agent,
|
|
2671
2675
|
})
|
|
2672
2676
|
}))
|
|
2677
|
+
this.app.get("/xterm_config", ex(async (req, res) => {
|
|
2678
|
+
let exists = await fse.pathExists(this.kernel.path("web"))
|
|
2679
|
+
if (exists) {
|
|
2680
|
+
let config_exists = await fse.pathExists(this.kernel.path("web/config.json"))
|
|
2681
|
+
if (config_exists) {
|
|
2682
|
+
let config = (await this.kernel.loader.load(this.kernel.path("web/config.json"))).resolved
|
|
2683
|
+
if (config) {
|
|
2684
|
+
if (config.xterm) {
|
|
2685
|
+
this.xterm = config.xterm
|
|
2686
|
+
console.log("this.xterm", this.xterm)
|
|
2687
|
+
}
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
}
|
|
2691
|
+
res.json({ config: this.xterm })
|
|
2692
|
+
}))
|
|
2673
2693
|
this.app.get("/du/:name", ex(async (req, res) => {
|
|
2674
2694
|
let p = this.kernel.path("api", req.params.name)
|
|
2675
2695
|
let d1 = await Util.du(p)
|
package/server/views/editor.ejs
CHANGED
|
@@ -572,34 +572,19 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
572
572
|
await this.createTerm()
|
|
573
573
|
await this.start(mode)
|
|
574
574
|
}
|
|
575
|
-
createTerm () {
|
|
575
|
+
async createTerm () {
|
|
576
576
|
if (!this.term) {
|
|
577
|
-
|
|
578
|
-
//theme: xtermTheme.Piatto_Light,
|
|
579
|
-
//theme: xtermTheme.Spring,
|
|
580
|
-
|
|
581
|
-
//theme: xtermTheme.Github,
|
|
582
|
-
|
|
583
|
-
//theme: xtermTheme.Cobalt_Neon, // top legibility
|
|
584
|
-
//theme: xtermTheme.Duotone_Dark,
|
|
585
|
-
theme: xtermTheme.FrontEndDelight,
|
|
586
|
-
//theme: xtermTheme.Seafoam_Pastel,
|
|
587
|
-
//theme: xtermTheme.IC_Green_PPL,
|
|
588
|
-
//theme: xtermTheme.FunForrest,
|
|
589
|
-
//theme: xtermTheme.Jackie_Brown,
|
|
590
|
-
//theme: xtermTheme.Ocean,
|
|
591
|
-
|
|
592
|
-
//theme: xtermTheme.Blazer,
|
|
593
|
-
//theme: xtermTheme.BirdsOfParadise,
|
|
594
|
-
//theme: xtermTheme.AtelierSulphurpool,
|
|
595
|
-
//theme: xtermTheme.Borland,
|
|
596
|
-
//rows: 20,
|
|
597
|
-
//cols: 1000,
|
|
577
|
+
let config = {
|
|
598
578
|
fontSize: 12,
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
579
|
+
theme: xtermTheme.FrontEndDelight
|
|
580
|
+
}
|
|
581
|
+
let res = await fetch("/xterm_config").then((res) => {
|
|
582
|
+
return res.json()
|
|
583
|
+
})
|
|
584
|
+
if (res && res.config) {
|
|
585
|
+
config = res.config
|
|
586
|
+
}
|
|
587
|
+
const term = new Terminal(config)
|
|
603
588
|
term.open(document.querySelector("#terminal"))
|
|
604
589
|
|
|
605
590
|
|
|
@@ -556,35 +556,20 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
556
556
|
await this.createTerm()
|
|
557
557
|
await this.start(mode)
|
|
558
558
|
}
|
|
559
|
-
createTerm () {
|
|
559
|
+
async createTerm () {
|
|
560
560
|
if (!this.term) {
|
|
561
|
-
|
|
561
|
+
let config = {
|
|
562
562
|
scrollback: 9999999,
|
|
563
|
-
//theme: xtermTheme.Piatto_Light,
|
|
564
|
-
//theme: xtermTheme.Spring,
|
|
565
|
-
|
|
566
|
-
//theme: xtermTheme.Github,
|
|
567
|
-
|
|
568
|
-
//theme: xtermTheme.Cobalt_Neon, // top legibility
|
|
569
|
-
//theme: xtermTheme.Duotone_Dark,
|
|
570
|
-
//theme: xtermTheme.Batman,
|
|
571
|
-
//theme: xtermTheme.Brogrammer,
|
|
572
|
-
theme: xtermTheme.FrontEndDelight,
|
|
573
|
-
//theme: xtermTheme.Seafoam_Pastel,
|
|
574
|
-
//theme: xtermTheme.IC_Green_PPL,
|
|
575
|
-
//theme: xtermTheme.FunForrest,
|
|
576
|
-
//theme: xtermTheme.Jackie_Brown,
|
|
577
|
-
//theme: xtermTheme.Ocean,
|
|
578
|
-
|
|
579
|
-
//theme: xtermTheme.Blazer,
|
|
580
|
-
//theme: xtermTheme.BirdsOfParadise,
|
|
581
|
-
//theme: xtermTheme.AtelierSulphurpool,
|
|
582
|
-
//theme: xtermTheme.Borland,
|
|
583
563
|
fontSize: 12,
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
564
|
+
theme: xtermTheme.FrontEndDelight
|
|
565
|
+
}
|
|
566
|
+
let res = await fetch("/xterm_config").then((res) => {
|
|
567
|
+
return res.json()
|
|
568
|
+
})
|
|
569
|
+
if (res && res.config) {
|
|
570
|
+
config = res.config
|
|
571
|
+
}
|
|
572
|
+
const term = new Terminal(config)
|
|
588
573
|
term.open(document.querySelector("#terminal"))
|
|
589
574
|
|
|
590
575
|
term.attachCustomKeyEventHandler(event => {
|