From bca11ddfd2ca8604a4d36d5ec6959184bb391d03 Mon Sep 17 00:00:00 2001 From: Prozilla Date: Sat, 4 May 2024 14:01:01 +0200 Subject: [PATCH] Fixed command piping --- src/components/apps/terminal/Terminal.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/apps/terminal/Terminal.jsx b/src/components/apps/terminal/Terminal.jsx index 2bfb129..2f1597b 100644 --- a/src/components/apps/terminal/Terminal.jsx +++ b/src/components/apps/terminal/Terminal.jsx @@ -211,13 +211,14 @@ export function Terminal({ startPath, input, setTitle, close: exit, active }) { const pipes = value.split(" | "); let output = null; - pipes.forEach((pipe) => { + pipes.forEach((pipe, index) => { + removeFromArray(pipe[index - 1], pipes); + if (output instanceof Stream) return; // Output from the previous command gets added as an argument for the next command output = handleInput(output ? `${pipe} ${output}` : pipe); - removeFromArray(pipe, pipes); }); if (output) {