diff --git a/packages/zosuss/__tests__/__unit__/Shell.unit.test.ts b/packages/zosuss/__tests__/__unit__/Shell.unit.test.ts index fd6afe1aa8..2064edbe37 100644 --- a/packages/zosuss/__tests__/__unit__/Shell.unit.test.ts +++ b/packages/zosuss/__tests__/__unit__/Shell.unit.test.ts @@ -61,11 +61,12 @@ function checkMockFunctionsWithCommand(command: string) { expect(mockConnect).toBeCalled(); expect(mockShell).toBeCalled(); - // Check the stream.end() fucntion is called with an argument containing the SSH command + // Check the stream.end() function is called with an argument containing the SSH command expect(mockStreamWrite.mock.calls[0][0]).toMatch(command); expect(mockStreamEnd).toHaveBeenCalled(); expect(stdoutHandler).toHaveBeenCalledWith("stdout data\n"); expect(stdoutHandler).toHaveBeenCalledWith("\rerror"); + expect(stdoutHandler).not.toContain("$") } describe("Shell", () => { diff --git a/packages/zosuss/src/Shell.ts b/packages/zosuss/src/Shell.ts index c3b557fb0f..771ab76bc4 100644 --- a/packages/zosuss/src/Shell.ts +++ b/packages/zosuss/src/Shell.ts @@ -94,8 +94,10 @@ export class Shell { dataToPrint = ""; isUserCommand = false; } else if (isUserCommand) { - // print out the user command result - stdoutHandler(dataToPrint); + // don't print out command, just print result + if (!dataToPrint.match(new RegExp("\\$"))){ + stdoutHandler(dataToPrint); + } dataToPrint = ""; } }