1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +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:
AnotherTest 2020-09-09 23:37:38 +04:30 committed by Andreas Kling
parent c296bcc1d9
commit 927e2fc6bc
2 changed files with 8 additions and 8 deletions

View file

@ -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());