pinokiod 3.0.25 → 3.0.27

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 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
  }
@@ -678,7 +688,6 @@ class Shell {
678
688
  this.kill()
679
689
  }
680
690
  })
681
- console.log("Exec finished", res)
682
691
  return res
683
692
  }
684
693
  stop(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.0.25",
3
+ "version": "3.0.27",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -716,7 +716,7 @@ class Server {
716
716
  }
717
717
 
718
718
  let template
719
- template = "fullscreen_editor"
719
+ template = "terminal"
720
720
 
721
721
  if (req.query && req.query.mode === "source") {
722
722
  template = "editor"
@@ -1230,9 +1230,6 @@ class Server {
1230
1230
  running = this.getItems(running, meta, p)
1231
1231
  notRunning = this.getItems(notRunning, meta, p)
1232
1232
 
1233
- console.log(JSON.stringify({ running, notRunning }, null, 2))
1234
-
1235
-
1236
1233
  // check running for each
1237
1234
  // running_items
1238
1235
  items = items.map((x) => {
@@ -1323,13 +1320,16 @@ class Server {
1323
1320
  if (config.color) this.colors.color = config.color
1324
1321
  if (config.symbolColor) this.colors.symbolColor = config.symbolColor
1325
1322
  }
1323
+ if (config.xterm) {
1324
+ this.xterm = config.xterm
1325
+ console.log("this.xterm", this.xterm)
1326
+ }
1326
1327
  }
1327
1328
  }
1328
1329
  }
1329
1330
 
1330
1331
  if (meta) {
1331
1332
  items = running.concat(notRunning)
1332
- console.log({ items })
1333
1333
  res.render("index", {
1334
1334
  home_url: `http://localhost:${this.port}`,
1335
1335
  proxy: home_proxy,
@@ -2670,6 +2670,22 @@ class Server {
2670
2670
  agent: this.agent,
2671
2671
  })
2672
2672
  }))
2673
+ this.app.get("/xterm_config", ex(async (req, res) => {
2674
+ let exists = await fse.pathExists(this.kernel.path("web"))
2675
+ if (exists) {
2676
+ let config_exists = await fse.pathExists(this.kernel.path("web/config.json"))
2677
+ if (config_exists) {
2678
+ let config = (await this.kernel.loader.load(this.kernel.path("web/config.json"))).resolved
2679
+ if (config) {
2680
+ if (config.xterm) {
2681
+ this.xterm = config.xterm
2682
+ console.log("this.xterm", this.xterm)
2683
+ }
2684
+ }
2685
+ }
2686
+ }
2687
+ res.json({ config: this.xterm })
2688
+ }))
2673
2689
  this.app.get("/du/:name", ex(async (req, res) => {
2674
2690
  let p = this.kernel.path("api", req.params.name)
2675
2691
  let d1 = await Util.du(p)
File without changes
@@ -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
- const term = new Terminal({
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
- //cursorBlink: false,
600
- //cursorStyle: 'block'
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
 
@@ -109,6 +109,7 @@ body.frozen {
109
109
  overflow: auto !important;
110
110
  }
111
111
  </style>
112
+ <link href="/terminal.css" rel="stylesheet"/>
112
113
  <script>
113
114
  document.addEventListener("DOMContentLoaded", async () => {
114
115
  <% if (error) { %>
@@ -556,35 +557,20 @@ document.addEventListener("DOMContentLoaded", async () => {
556
557
  await this.createTerm()
557
558
  await this.start(mode)
558
559
  }
559
- createTerm () {
560
+ async createTerm () {
560
561
  if (!this.term) {
561
- const term = new Terminal({
562
+ let config = {
562
563
  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
564
  fontSize: 12,
584
- //cursorBlink: false,
585
- //cursorStyle: 'block'
586
-
587
- });
565
+ theme: xtermTheme.FrontEndDelight
566
+ }
567
+ let res = await fetch("/xterm_config").then((res) => {
568
+ return res.json()
569
+ })
570
+ if (res && res.config) {
571
+ config = res.config
572
+ }
573
+ const term = new Terminal(config)
588
574
  term.open(document.querySelector("#terminal"))
589
575
 
590
576
  term.attachCustomKeyEventHandler(event => {