codify-plugin-lib 1.0.168 → 1.0.170

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.
@@ -74,7 +74,7 @@ export class BackgroundPty {
74
74
  // Redirecting everything to the pipe and running in theb background avoids most if not all back-pressure problems
75
75
  // Done is used to denote the end of the command
76
76
  // Use the \\" at the end differentiate between command and response. \\" will evaluate to " in the terminal
77
- const command = `((${cdCommand}${cmd}; echo %%%$?%%%done%%%\\") > "/tmp/${cid}" 2>&1 &); echo %%%done%%%${cid}\\";`;
77
+ const command = ` ((${cdCommand}${cmd}; echo %%%$?%%%done%%%\\") > "/tmp/${cid}" 2>&1 &); echo %%%done%%%${cid}\\";`;
78
78
  let output = '';
79
79
  const listener = this.basePty.onData((data) => {
80
80
  output += data;
@@ -83,7 +83,7 @@ export class BackgroundPty {
83
83
  resolve(null);
84
84
  }
85
85
  });
86
- console.log(`Running command ${cmd}`);
86
+ console.log(`Running command ${cmd}${options?.cwd ? ` (cwd: ${options.cwd})` : ''}`);
87
87
  this.basePty.write(`${command}\r`);
88
88
  }));
89
89
  }).finally(async () => {
@@ -103,10 +103,10 @@ export class BackgroundPty {
103
103
  await this.promiseQueue.run(async () => {
104
104
  let outputBuffer = '';
105
105
  return new Promise(resolve => {
106
- this.basePty.write('set +o history;\n');
107
- this.basePty.write('unset PS1;\n');
108
- this.basePty.write('unset PS0;\n');
109
- this.basePty.write('echo setup complete\\"\n');
106
+ this.basePty.write('setopt hist_ignore_space;\n');
107
+ this.basePty.write(' unset PS1;\n');
108
+ this.basePty.write(' unset PS0;\n');
109
+ this.basePty.write(' echo setup complete\\"\n');
110
110
  const listener = this.basePty.onData((data) => {
111
111
  outputBuffer += data;
112
112
  if (outputBuffer.includes('setup complete"')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codify-plugin-lib",
3
- "version": "1.0.168",
3
+ "version": "1.0.170",
4
4
  "description": "Library plugin library",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -89,7 +89,7 @@ export class BackgroundPty implements IPty {
89
89
  // Redirecting everything to the pipe and running in theb background avoids most if not all back-pressure problems
90
90
  // Done is used to denote the end of the command
91
91
  // Use the \\" at the end differentiate between command and response. \\" will evaluate to " in the terminal
92
- const command = `((${cdCommand}${cmd}; echo %%%$?%%%done%%%\\") > "/tmp/${cid}" 2>&1 &); echo %%%done%%%${cid}\\";`
92
+ const command = ` ((${cdCommand}${cmd}; echo %%%$?%%%done%%%\\") > "/tmp/${cid}" 2>&1 &); echo %%%done%%%${cid}\\";`
93
93
 
94
94
  let output = '';
95
95
  const listener = this.basePty.onData((data: any) => {
@@ -101,7 +101,7 @@ export class BackgroundPty implements IPty {
101
101
  }
102
102
  });
103
103
 
104
- console.log(`Running command ${cmd}`)
104
+ console.log(`Running command ${cmd}${options?.cwd ? ` (cwd: ${options.cwd})` : ''}`)
105
105
  this.basePty.write(`${command}\r`);
106
106
 
107
107
  }));
@@ -127,10 +127,10 @@ export class BackgroundPty implements IPty {
127
127
  let outputBuffer = '';
128
128
 
129
129
  return new Promise(resolve => {
130
- this.basePty.write('set +o history;\n');
131
- this.basePty.write('unset PS1;\n');
132
- this.basePty.write('unset PS0;\n')
133
- this.basePty.write('echo setup complete\\"\n')
130
+ this.basePty.write('setopt hist_ignore_space;\n');
131
+ this.basePty.write(' unset PS1;\n');
132
+ this.basePty.write(' unset PS0;\n')
133
+ this.basePty.write(' echo setup complete\\"\n')
134
134
 
135
135
  const listener = this.basePty.onData((data: string) => {
136
136
  outputBuffer += data;