Skip to content

Commit a5c8893

Browse files
committed
feat: bug with commands still being written to the history
1 parent f739057 commit a5c8893

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codify-plugin-lib",
3-
"version": "1.0.169",
3+
"version": "1.0.170",
44
"description": "Library plugin library",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

src/pty/background-pty.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class BackgroundPty implements IPty {
8989
// Redirecting everything to the pipe and running in theb background avoids most if not all back-pressure problems
9090
// Done is used to denote the end of the command
9191
// 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}\\";`
9393

9494
let output = '';
9595
const listener = this.basePty.onData((data: any) => {
@@ -127,10 +127,10 @@ export class BackgroundPty implements IPty {
127127
let outputBuffer = '';
128128

129129
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')
134134

135135
const listener = this.basePty.onData((data: string) => {
136136
outputBuffer += data;

0 commit comments

Comments
 (0)