summaryrefslogtreecommitdiff
path: root/Userland/Shell/Shell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Shell/Shell.cpp')
-rw-r--r--Userland/Shell/Shell.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp
index c6168b8882..45954c7678 100644
--- a/Userland/Shell/Shell.cpp
+++ b/Userland/Shell/Shell.cpp
@@ -730,7 +730,12 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
}
}
- if (command.argv.is_empty() && !command.next_chain.is_empty() && command.should_immediately_execute_next && command.next_chain.first().node->should_override_execution_in_current_process()) {
+ if (command.argv.is_empty()
+ && !command.next_chain.is_empty()
+ && command.should_immediately_execute_next
+ && command.redirections.is_empty()
+ && command.next_chain.first().node->should_override_execution_in_current_process()) {
+
for (auto& next_in_chain : command.next_chain)
run_tail(command, next_in_chain, last_return_code);
return nullptr;