mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:07:35 +00:00
Shell: Do not reset the terminal attributes when command is run in bg
Also removes a FIXME that no longer applies.
This commit is contained in:
parent
c296bcc1d9
commit
927e2fc6bc
2 changed files with 8 additions and 8 deletions
|
@ -348,10 +348,6 @@ void Background::dump(int level) const
|
|||
|
||||
RefPtr<Value> Background::run(RefPtr<Shell> shell)
|
||||
{
|
||||
// FIXME: Currently this does not work correctly if `m_command.would_execute()',
|
||||
// as it runs the node, which means nodes likes And and Or will evaluate
|
||||
// all but their last subnode before yielding to this, causing a command
|
||||
// like `foo && bar&` to effectively be `foo && (bar&)`.
|
||||
auto commands = m_command->to_lazy_evaluated_commands(shell);
|
||||
for (auto& command : commands)
|
||||
command.should_wait = false;
|
||||
|
|
|
@ -541,16 +541,13 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
|
|||
if (child == 0) {
|
||||
close(sync_pipe[1]);
|
||||
|
||||
if (!m_is_subshell)
|
||||
tcsetattr(0, TCSANOW, &default_termios);
|
||||
|
||||
m_is_subshell = true;
|
||||
m_pid = getpid();
|
||||
Core::EventLoop::notify_forked(Core::EventLoop::ForkEvent::Child);
|
||||
jobs.clear();
|
||||
|
||||
if (apply_rewirings() == IterationDecision::Break)
|
||||
return nullptr;
|
||||
_exit(126);
|
||||
|
||||
fds.collect();
|
||||
|
||||
|
@ -564,8 +561,15 @@ RefPtr<Job> Shell::run_command(const AST::Command& command)
|
|||
dbg() << "Oof";
|
||||
}
|
||||
|
||||
#ifdef SH_DEBUG
|
||||
dbg() << "Synced up with parent, we're good to exec()";
|
||||
#endif
|
||||
|
||||
close(sync_pipe[0]);
|
||||
|
||||
if (!m_is_subshell && command.should_wait)
|
||||
tcsetattr(0, TCSANOW, &default_termios);
|
||||
|
||||
if (command.should_immediately_execute_next) {
|
||||
ASSERT(command.argv.is_empty());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue