mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-15 00:51:12 -03:00
Simplify maybe_assign_terminal()
Move this out of postfork, it is not called after fork.
This commit is contained in:
@@ -117,6 +117,13 @@ char *get_interpreter(const char *command, char *interpreter, size_t buff_size)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/// Assign the terminal to a job.
|
||||
static void maybe_assign_terminal(const job_t *j) {
|
||||
if (j->wants_terminal() && j->is_foreground()) {
|
||||
terminal_give_to_job(j, false /*new job, so not continuing*/);
|
||||
}
|
||||
}
|
||||
|
||||
/// This function is executed by the child process created by a call to fork(). It should be called
|
||||
/// after \c child_setup_process. It calls execve to replace the fish process image with the command
|
||||
/// specified in \c p. It never returns. Called in a forked child! Do not allocate memory, etc.
|
||||
|
||||
Reference in New Issue
Block a user