pinokiod 3.2.159 → 3.2.161
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 -15
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -554,18 +554,18 @@ class Shell {
|
|
|
554
554
|
if (env_exists) {
|
|
555
555
|
conda_activation = [
|
|
556
556
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
557
|
-
`conda deactivate`,
|
|
558
|
-
`conda deactivate`,
|
|
559
|
-
`conda deactivate`,
|
|
557
|
+
// `conda deactivate`,
|
|
558
|
+
// `conda deactivate`,
|
|
559
|
+
// `conda deactivate`,
|
|
560
560
|
`conda activate ${env_path}`,
|
|
561
561
|
]
|
|
562
562
|
} else {
|
|
563
563
|
conda_activation = [
|
|
564
564
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
565
565
|
`conda create -y -p ${env_path} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
566
|
-
`conda deactivate`,
|
|
567
|
-
`conda deactivate`,
|
|
568
|
-
`conda deactivate`,
|
|
566
|
+
// `conda deactivate`,
|
|
567
|
+
// `conda deactivate`,
|
|
568
|
+
// `conda deactivate`,
|
|
569
569
|
`conda activate ${env_path}`,
|
|
570
570
|
]
|
|
571
571
|
}
|
|
@@ -573,9 +573,9 @@ class Shell {
|
|
|
573
573
|
if (conda_name === "base") {
|
|
574
574
|
conda_activation = [
|
|
575
575
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
576
|
-
`conda deactivate`,
|
|
577
|
-
`conda deactivate`,
|
|
578
|
-
`conda deactivate`,
|
|
576
|
+
// `conda deactivate`,
|
|
577
|
+
// `conda deactivate`,
|
|
578
|
+
// `conda deactivate`,
|
|
579
579
|
`conda activate ${conda_name}`,
|
|
580
580
|
]
|
|
581
581
|
} else {
|
|
@@ -585,18 +585,18 @@ class Shell {
|
|
|
585
585
|
if (env_exists) {
|
|
586
586
|
conda_activation = [
|
|
587
587
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
588
|
-
`conda deactivate`,
|
|
589
|
-
`conda deactivate`,
|
|
590
|
-
`conda deactivate`,
|
|
588
|
+
// `conda deactivate`,
|
|
589
|
+
// `conda deactivate`,
|
|
590
|
+
// `conda deactivate`,
|
|
591
591
|
`conda activate ${conda_name}`,
|
|
592
592
|
]
|
|
593
593
|
} else {
|
|
594
594
|
conda_activation = [
|
|
595
595
|
(this.platform === 'win32' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
596
596
|
`conda create -y -n ${conda_name} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
597
|
-
`conda deactivate`,
|
|
598
|
-
`conda deactivate`,
|
|
599
|
-
`conda deactivate`,
|
|
597
|
+
// `conda deactivate`,
|
|
598
|
+
// `conda deactivate`,
|
|
599
|
+
// `conda deactivate`,
|
|
600
600
|
`conda activate ${conda_name}`,
|
|
601
601
|
]
|
|
602
602
|
}
|
|
@@ -720,6 +720,7 @@ class Shell {
|
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
kill(message, force) {
|
|
723
|
+
console.log("> KILL", { message, force })
|
|
723
724
|
|
|
724
725
|
this.done = true
|
|
725
726
|
this.ready = false
|
|
@@ -827,6 +828,7 @@ ${cleaned}
|
|
|
827
828
|
|
|
828
829
|
}
|
|
829
830
|
stream(msg, callback) {
|
|
831
|
+
console.log("# STREAM", msg)
|
|
830
832
|
this.vt.write(msg, () => {
|
|
831
833
|
let buf = this.vts.serialize()
|
|
832
834
|
let cleaned = this.stripAnsi(buf)
|
|
@@ -844,11 +846,13 @@ ${cleaned}
|
|
|
844
846
|
let termination_prompt_re = new RegExp(this.prompt_pattern + "[ \r\n]*$", "g")
|
|
845
847
|
let line = cleaned.replaceAll(/[\r\n]/g, "")
|
|
846
848
|
let test = line.match(termination_prompt_re)
|
|
849
|
+
console.log({ line, test, termination_prompt_re })
|
|
847
850
|
if (test) {
|
|
848
851
|
let cache = cleaned
|
|
849
852
|
let cached_msg = msg
|
|
850
853
|
// todo: may need to handle cases when the command returns immediately with no output (example: 'which brew' returns immediately with no text if brew doesn't exist)
|
|
851
854
|
setTimeout(() => {
|
|
855
|
+
console.log({ cache, cleaned })
|
|
852
856
|
if (cache === cleaned) {
|
|
853
857
|
if (this.persistent) {
|
|
854
858
|
if (this.cb) this.cb({
|