mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-22 02:09:24 +00:00
Shell: Add the `disown' shell builtin
This commit is contained in:
parent
4cbe202d2c
commit
0d39418b0b
Notes:
sideshowbarker
2024-07-19 06:10:01 +09:00
Author: https://github.com/alimpfard
Commit: 0d39418b0b
Pull-request: https://github.com/SerenityOS/serenity/pull/2361
Reviewed-by: https://github.com/awesomekling
Reviewed-by: https://github.com/bugaevc
3 changed files with 67 additions and 2 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue