Remove the foreground job property

This was not used consistently and was confused with the foreground job
flag. Whether a job is foreground is mutable, so it should remain a flag.
This commit is contained in:
ridiculousfish 2019-06-29 15:38:00 -07:00
parent 98ba7d7790
commit 2931d869d5
2 changed files with 2 additions and 5 deletions

View File

@ -1239,7 +1239,6 @@ parse_execution_result_t parse_execution_context_t::run_1_job(tnode_t<g::job> jo
((job_control_mode == job_control_t::interactive) && parser->is_interactive());
job_t::properties_t props{};
props.foreground = !job_node_is_background(job_node);
props.wants_terminal = wants_job_control && !ld.is_event;
props.skip_notification =
ld.is_subshell || ld.is_block || ld.is_event || !parser->is_interactive();
@ -1248,6 +1247,7 @@ parse_execution_result_t parse_execution_context_t::run_1_job(tnode_t<g::job> jo
shared_ptr<job_t> job = std::make_shared<job_t>(acquire_job_id(), props, block_io, parent_job);
job->tmodes = tmodes;
job->set_flag(job_flag_t::FOREGROUND, !job_node_is_background(job_node));
job->set_flag(job_flag_t::JOB_CONTROL, wants_job_control);
// We are about to populate a job. One possible argument to the job is a command substitution

View File

@ -287,9 +287,6 @@ class job_t {
/// A set of jobs properties. These are immutable: they do not change for the lifetime of the
/// job.
struct properties_t {
/// Whether this job is in the foreground, i.e. whether it did NOT have a & at the end.
bool foreground{};
/// Whether the specified job is a part of a subshell, event handler or some other form of
/// special job that should not be reported.
bool skip_notification{};
@ -414,7 +411,7 @@ class job_t {
/// The job has been fully constructed, i.e. all its member processes have been launched
bool is_constructed() const { return get_flag(job_flag_t::CONSTRUCTED); }
/// The job was launched in the foreground and has control of the terminal
bool is_foreground() const { return properties.foreground; }
bool is_foreground() const { return get_flag(job_flag_t::FOREGROUND); }
/// The job is complete, i.e. all its member processes have been reaped
bool is_completed() const;
/// The job is in a stopped state