pinokiod 7.5.37 → 7.5.38

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
@@ -351,16 +351,14 @@ class Shell {
351
351
  !(params && params.input) &&
352
352
  this.hasCondaCommand(params && params.message)
353
353
  }
354
- buildCmdEchoSuppressedCommand(command) {
355
- return `@echo off\r\n${command}\r\n@echo on`
356
- }
357
354
  prepareCommandExecution(params, command) {
358
355
  if (!this.shouldSuppressCmdEchoForConda(params)) {
359
356
  return { command }
360
357
  }
361
358
  return {
362
- command: this.buildCmdEchoSuppressedCommand(command),
359
+ command,
363
360
  preview: command,
361
+ quietCmd: true,
364
362
  }
365
363
  }
366
364
  isUnresolvedTemplate(value) {
@@ -444,6 +442,7 @@ class Shell {
444
442
  this.commandEchoPreview = null
445
443
  this.commandEchoPreviewed = false
446
444
  this.exec_cmd = null
445
+ this.quietCmdExecution = false
447
446
 
448
447
  /*
449
448
  params := {
@@ -1440,6 +1439,7 @@ class Shell {
1440
1439
  this.exec_cmd = preparedCommand.command
1441
1440
  this.commandEchoPreview = preparedCommand.preview || null
1442
1441
  this.commandEchoPreviewed = false
1442
+ this.quietCmdExecution = !!preparedCommand.quietCmd
1443
1443
  let res = await new Promise((resolve, reject) => {
1444
1444
  this.resolve = resolve
1445
1445
  this.reject = reject
@@ -1459,7 +1459,10 @@ class Shell {
1459
1459
  if (!this.ptyProcess) {
1460
1460
  // ptyProcess doesn't exist => create
1461
1461
  this.done = false
1462
- this.ptyProcess = pty.spawn(this.shell, this.args, config)
1462
+ const shellArgs = this.quietCmdExecution && this.isCmdShell()
1463
+ ? this.args.concat(this.args.some((arg) => /^\/q$/i.test(arg)) ? [] : ["/Q"])
1464
+ : this.args
1465
+ this.ptyProcess = pty.spawn(this.shell, shellArgs, config)
1463
1466
  this.ptyProcess.onData((data) => {
1464
1467
  if (!this.monitor) {
1465
1468
  this.monitor = ""
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "7.5.37",
3
+ "version": "7.5.38",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -941,7 +941,8 @@ test('Windows cmd suppresses echo only for explicit conda shell.run commands', (
941
941
  message: 'conda install -y -c conda-forge ffmpeg',
942
942
  }, command)
943
943
  assert.equal(prepared.preview, command)
944
- assert.equal(prepared.command, `@echo off\r\n${command}\r\n@echo on`)
944
+ assert.equal(prepared.command, command)
945
+ assert.equal(prepared.quietCmd, true)
945
946
 
946
947
  assert.deepEqual(shell.prepareCommandExecution({
947
948
  message: 'python main.py',