mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Prevent shell sync commands from polluting history (#6668)
* Prevent shell sync commands from polluting history Signed-off-by: Sebastian Malton <sebastian@malton.name> * Fix tests Signed-off-by: Sebastian Malton <sebastian@malton.name> Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
8db81a4731
commit
ed26e245e6
@ -84,6 +84,7 @@ const computeUnixShellEnvironmentInjectable = getInjectable({
|
||||
} else if (!cshLikeShellName.test(shellName)) {
|
||||
// zsh (at least, maybe others) don't load RC files when in non-interactive mode, even when using -l (login) option
|
||||
shellArgs.push("-i");
|
||||
command = ` ${command}`; // This prevents the command from being added to the history
|
||||
} else {
|
||||
// Some shells don't support any other options when providing the -l (login) shell option
|
||||
}
|
||||
|
||||
@ -218,7 +218,7 @@ describe("computeUnixShellEnvironment technical tests", () => {
|
||||
});
|
||||
|
||||
it("should send the command via stdin", () => {
|
||||
expect(stdinValue).toBe(`'/some/process/exec/path' -p '"deadbeef" + JSON.stringify(process.env) + "deadbeef"'`);
|
||||
expect(stdinValue).toBe(` '/some/process/exec/path' -p '"deadbeef" + JSON.stringify(process.env) + "deadbeef"'`);
|
||||
});
|
||||
|
||||
it("should close stdin", () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user