Shell: Add the `disown' shell builtin

This commit is contained in:
AnotherTest 2020-05-24 21:01:39 +04:30 committed by Andreas Kling
commit 0d39418b0b
Notes: sideshowbarker 2024-07-19 06:10:01 +09:00
3 changed files with 67 additions and 2 deletions

View file

@ -42,8 +42,10 @@ public:
~Job()
{
auto elapsed = m_command_timer.elapsed();
dbg() << "Command \"" << m_cmd << "\" finished in " << elapsed << " ms";
if (m_active) {
auto elapsed = m_command_timer.elapsed();
dbg() << "Command \"" << m_cmd << "\" finished in " << elapsed << " ms";
}
}
Job(pid_t pid, unsigned pgid, String cmd, u64 job_id)
@ -79,6 +81,8 @@ public:
m_running_in_background = running_in_background;
}
void deactivate() const { m_active = false; }
private:
unsigned m_pgid { 0 };
pid_t m_pid { 0 };
@ -88,4 +92,5 @@ private:
bool m_running_in_background { false };
int m_exit_code { -1 };
Core::ElapsedTimer m_command_timer;
mutable bool m_active { true };
};