pinokiod 3.19.28 → 3.19.29
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 +11 -11
- package/package.json +1 -1
package/kernel/shell.js
CHANGED
|
@@ -128,7 +128,7 @@ class Shell {
|
|
|
128
128
|
} else if (this.env.PATH) {
|
|
129
129
|
PATH_KEY = "PATH"
|
|
130
130
|
}
|
|
131
|
-
if (this.
|
|
131
|
+
if (this.shell === "cmd.exe") {
|
|
132
132
|
// ignore
|
|
133
133
|
} else {
|
|
134
134
|
this.env[PATH_KEY]= this.kernel.shellpath || [
|
|
@@ -433,7 +433,7 @@ class Shell {
|
|
|
433
433
|
|
|
434
434
|
// Log before resolving
|
|
435
435
|
this._log(buf, cleaned)
|
|
436
|
-
if (this.
|
|
436
|
+
if (this.shell === 'cmd.exe') {
|
|
437
437
|
// For Windows
|
|
438
438
|
this.vt.write('\x1Bc');
|
|
439
439
|
//this.ptyProcess.write('cls\n');
|
|
@@ -565,7 +565,7 @@ class Shell {
|
|
|
565
565
|
// if params.message is empty, filter out
|
|
566
566
|
//let delimiter = " && "
|
|
567
567
|
let delimiter
|
|
568
|
-
if (this.
|
|
568
|
+
if (this.shell === "cmd.exe") {
|
|
569
569
|
if (params.chain) {
|
|
570
570
|
if (params.chain === "&") {
|
|
571
571
|
delimiter = " && "; // stop if one command in the chain fails
|
|
@@ -692,7 +692,7 @@ class Shell {
|
|
|
692
692
|
// 2. conda_activation
|
|
693
693
|
|
|
694
694
|
let timeout
|
|
695
|
-
if (this.
|
|
695
|
+
if (this.shell === "cmd.exe") {
|
|
696
696
|
timeout = 'C:\\Windows\\System32\\timeout /t 1 > nul'
|
|
697
697
|
} else {
|
|
698
698
|
timeout = 'sleep 1'
|
|
@@ -703,7 +703,7 @@ class Shell {
|
|
|
703
703
|
if (typeof conda_activate === "string") {
|
|
704
704
|
if (conda_activate === "minimal") {
|
|
705
705
|
conda_activation = [
|
|
706
|
-
(this.
|
|
706
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
707
707
|
'conda activate base',
|
|
708
708
|
]
|
|
709
709
|
}
|
|
@@ -715,7 +715,7 @@ class Shell {
|
|
|
715
715
|
let env_exists = await this.exists(env_path)
|
|
716
716
|
if (env_exists) {
|
|
717
717
|
conda_activation = [
|
|
718
|
-
(this.
|
|
718
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
719
719
|
`conda deactivate`,
|
|
720
720
|
`conda deactivate`,
|
|
721
721
|
`conda deactivate`,
|
|
@@ -725,7 +725,7 @@ class Shell {
|
|
|
725
725
|
]
|
|
726
726
|
} else {
|
|
727
727
|
conda_activation = [
|
|
728
|
-
(this.
|
|
728
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
729
729
|
`conda create -y -p ${env_path} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
730
730
|
`conda deactivate`,
|
|
731
731
|
`conda deactivate`,
|
|
@@ -738,7 +738,7 @@ class Shell {
|
|
|
738
738
|
} else if (conda_name) {
|
|
739
739
|
if (conda_name === "base") {
|
|
740
740
|
conda_activation = [
|
|
741
|
-
(this.
|
|
741
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
742
742
|
`conda deactivate`,
|
|
743
743
|
`conda deactivate`,
|
|
744
744
|
`conda deactivate`,
|
|
@@ -752,7 +752,7 @@ class Shell {
|
|
|
752
752
|
let env_exists = await this.exists(env_path)
|
|
753
753
|
if (env_exists) {
|
|
754
754
|
conda_activation = [
|
|
755
|
-
(this.
|
|
755
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
756
756
|
`conda deactivate`,
|
|
757
757
|
`conda deactivate`,
|
|
758
758
|
`conda deactivate`,
|
|
@@ -762,7 +762,7 @@ class Shell {
|
|
|
762
762
|
]
|
|
763
763
|
} else {
|
|
764
764
|
conda_activation = [
|
|
765
|
-
(this.
|
|
765
|
+
(this.shell === 'cmd.exe' ? 'conda_hook' : `eval "$(conda shell.bash hook)"`),
|
|
766
766
|
`conda create -y -n ${conda_name} ${conda_python} ${conda_args ? conda_args : ''}`,
|
|
767
767
|
`conda deactivate`,
|
|
768
768
|
`conda deactivate`,
|
|
@@ -1243,7 +1243,7 @@ ${cleaned}
|
|
|
1243
1243
|
this.params.onready()
|
|
1244
1244
|
}
|
|
1245
1245
|
if (this.ptyProcess) {
|
|
1246
|
-
this.ptyProcess.write(`${this.cmd}${
|
|
1246
|
+
this.ptyProcess.write(`${this.cmd}${this.EOL}`)
|
|
1247
1247
|
// setTimeout(() => {
|
|
1248
1248
|
// this.ptyProcess.write('\x1B[?2004h');
|
|
1249
1249
|
// }, 500)
|